mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Prevent premature Bob t1 timeout
Bob was hitting the t1 timeout and entering cancel instead of redeem. This was resolved by increasing the timeouts to 50.
This commit is contained in:
parent
27d1334726
commit
f5d3d54b13
@ -13,7 +13,7 @@ use libp2p::request_response::ResponseChannel;
|
||||
use sha2::Sha256;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use tokio::time::timeout;
|
||||
use tracing::trace;
|
||||
use tracing::{info, trace};
|
||||
use xmr_btc::{
|
||||
alice,
|
||||
alice::State3,
|
||||
@ -183,6 +183,7 @@ pub async fn publish_bitcoin_redeem_transaction<W>(
|
||||
where
|
||||
W: BroadcastSignedTransaction + WaitForTransactionFinality,
|
||||
{
|
||||
info!("Attempting to publish bitcoin redeem txn");
|
||||
let tx_id = bitcoin_wallet
|
||||
.broadcast_signed_transaction(redeem_tx)
|
||||
.await?;
|
||||
|
@ -271,22 +271,10 @@ where
|
||||
// }
|
||||
Ok(BobState::BtcRefunded)
|
||||
}
|
||||
BobState::BtcRefunded => {
|
||||
info!("btc refunded");
|
||||
Ok(BobState::BtcRefunded)
|
||||
}
|
||||
BobState::Punished => {
|
||||
info!("punished");
|
||||
Ok(BobState::Punished)
|
||||
}
|
||||
BobState::SafelyAborted => {
|
||||
info!("safely aborted");
|
||||
Ok(BobState::SafelyAborted)
|
||||
}
|
||||
BobState::XmrRedeemed => {
|
||||
info!("xmr redeemed");
|
||||
Ok(BobState::XmrRedeemed)
|
||||
}
|
||||
BobState::BtcRefunded => Ok(BobState::BtcRefunded),
|
||||
BobState::Punished => Ok(BobState::Punished),
|
||||
BobState::SafelyAborted => Ok(BobState::SafelyAborted),
|
||||
BobState::XmrRedeemed => Ok(BobState::XmrRedeemed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ pub mod state;
|
||||
pub mod storage;
|
||||
pub mod tor;
|
||||
|
||||
pub const REFUND_TIMELOCK: u32 = 10; // Relative timelock, this is number of blocks. TODO: What should it be?
|
||||
pub const PUNISH_TIMELOCK: u32 = 10; // FIXME: What should this be?
|
||||
pub const REFUND_TIMELOCK: u32 = 50; // Relative timelock, this is number of blocks. TODO: What should it be?
|
||||
pub const PUNISH_TIMELOCK: u32 = 50; // FIXME: What should this be?
|
||||
|
||||
pub type Never = std::convert::Infallible;
|
||||
|
||||
|
@ -10,7 +10,6 @@ use swap::{
|
||||
};
|
||||
use tempfile::tempdir;
|
||||
use testcontainers::clients::Cli;
|
||||
use tracing_subscriber::util::SubscriberInitExt as _;
|
||||
use uuid::Uuid;
|
||||
use xmr_btc::{alice::State0, bitcoin, config::Config, cross_curve_dleq};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user