Skip to content

Commit

Permalink
Increase the WAIT_CONFIRM_INTERVAL as it was set to 1 for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
artemii235 committed Oct 29, 2019
1 parent 0b9e5d3 commit c5c9a57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions mm2src/lp_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ const BASIC_COMM_TIMEOUT: u64 = 90;
const PAYMENT_LOCKTIME: u64 = 3600 * 2 + 300 * 2;
const _SWAP_DEFAULT_NUM_CONFIRMS: u32 = 1;
const _SWAP_DEFAULT_MAX_CONFIRMS: u32 = 6;
/// MM2 checks that swap payment is confirmed every WAIT_CONFIRM_INTERVAL seconds
const WAIT_CONFIRM_INTERVAL: u64 = 15;

#[derive(Debug, PartialEq, Serialize)]
pub enum RecoveredSwapAction {
Expand Down
4 changes: 2 additions & 2 deletions mm2src/lp_swap/maker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use super::{broadcast_my_swap_status, dex_fee_amount, get_locked_amount_by_other
lp_atomic_locktime, my_swap_file_path,
AtomicSwap, LockedAmount, MySwapInfo, RecoveredSwap, RecoveredSwapAction,
SavedSwap, SwapsContext, SwapError, SwapNegotiationData,
BASIC_COMM_TIMEOUT};
BASIC_COMM_TIMEOUT, WAIT_CONFIRM_INTERVAL};

pub fn stats_maker_swap_file_path(ctx: &MmArc, uuid: &str) -> PathBuf {
ctx.dbdir().join("SWAPS").join("STATS").join("MAKER").join(format!("{}.json", uuid))
Expand Down Expand Up @@ -552,7 +552,7 @@ impl MakerSwap {
&unwrap!(self.r().taker_payment.clone()).tx_hex,
self.r().data.taker_payment_confirmations,
wait_taker_payment,
1,
WAIT_CONFIRM_INTERVAL,
).compat();

if let Err(err) = wait_f.await {
Expand Down
4 changes: 2 additions & 2 deletions mm2src/lp_swap/taker_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use super::{broadcast_my_swap_status, dex_fee_amount, get_locked_amount_by_other
lp_atomic_locktime, my_swap_file_path,
AtomicSwap, LockedAmount, MySwapInfo, RecoveredSwap, RecoveredSwapAction,
SavedSwap, SwapsContext, SwapError, SwapNegotiationData,
BASIC_COMM_TIMEOUT};
BASIC_COMM_TIMEOUT, WAIT_CONFIRM_INTERVAL};

pub fn stats_taker_swap_file_path(ctx: &MmArc, uuid: &str) -> PathBuf {
ctx.dbdir().join("SWAPS").join("STATS").join("TAKER").join(format!("{}.json", uuid))
Expand Down Expand Up @@ -701,7 +701,7 @@ impl TakerSwap {
&unwrap!(self.r().maker_payment.clone()).tx_hex,
self.r().data.maker_payment_confirmations,
self.r().data.maker_payment_wait,
1,
WAIT_CONFIRM_INTERVAL,
);
if let Err(err) = f.compat().await {
return Ok((
Expand Down

0 comments on commit c5c9a57

Please sign in to comment.