|
|
@ -15,7 +15,9 @@ impl Config {
|
|
|
|
bob_time_to_act: *mainnet::BOB_TIME_TO_ACT,
|
|
|
|
bob_time_to_act: *mainnet::BOB_TIME_TO_ACT,
|
|
|
|
bitcoin_finality_confirmations: mainnet::BITCOIN_FINALITY_CONFIRMATIONS,
|
|
|
|
bitcoin_finality_confirmations: mainnet::BITCOIN_FINALITY_CONFIRMATIONS,
|
|
|
|
bitcoin_avg_block_time: *mainnet::BITCOIN_AVG_BLOCK_TIME,
|
|
|
|
bitcoin_avg_block_time: *mainnet::BITCOIN_AVG_BLOCK_TIME,
|
|
|
|
monero_max_finality_time: *mainnet::MONERO_AVG_BLOCK_TIME
|
|
|
|
// We apply a scaling factor (1.5) so that the swap is not aborted when the
|
|
|
|
|
|
|
|
// blockchain is slow
|
|
|
|
|
|
|
|
monero_max_finality_time: (*mainnet::MONERO_AVG_BLOCK_TIME).mul_f64(1.5)
|
|
|
|
* mainnet::MONERO_FINALITY_CONFIRMATIONS,
|
|
|
|
* mainnet::MONERO_FINALITY_CONFIRMATIONS,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -25,7 +27,9 @@ impl Config {
|
|
|
|
bob_time_to_act: *regtest::BOB_TIME_TO_ACT,
|
|
|
|
bob_time_to_act: *regtest::BOB_TIME_TO_ACT,
|
|
|
|
bitcoin_finality_confirmations: regtest::BITCOIN_FINALITY_CONFIRMATIONS,
|
|
|
|
bitcoin_finality_confirmations: regtest::BITCOIN_FINALITY_CONFIRMATIONS,
|
|
|
|
bitcoin_avg_block_time: *regtest::BITCOIN_AVG_BLOCK_TIME,
|
|
|
|
bitcoin_avg_block_time: *regtest::BITCOIN_AVG_BLOCK_TIME,
|
|
|
|
monero_max_finality_time: *regtest::MONERO_AVG_BLOCK_TIME
|
|
|
|
// We apply a scaling factor (1.5) so that the swap is not aborted when the
|
|
|
|
|
|
|
|
// blockchain is slow
|
|
|
|
|
|
|
|
monero_max_finality_time: (*regtest::MONERO_AVG_BLOCK_TIME).mul_f64(1.5)
|
|
|
|
* regtest::MONERO_FINALITY_CONFIRMATIONS,
|
|
|
|
* regtest::MONERO_FINALITY_CONFIRMATIONS,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -41,7 +45,7 @@ mod mainnet {
|
|
|
|
|
|
|
|
|
|
|
|
pub static BITCOIN_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(10 * 60));
|
|
|
|
pub static BITCOIN_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(10 * 60));
|
|
|
|
|
|
|
|
|
|
|
|
pub static MONERO_FINALITY_CONFIRMATIONS: u32 = 10;
|
|
|
|
pub static MONERO_FINALITY_CONFIRMATIONS: u32 = 15;
|
|
|
|
|
|
|
|
|
|
|
|
pub static MONERO_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(2 * 60));
|
|
|
|
pub static MONERO_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(2 * 60));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -58,5 +62,5 @@ mod regtest {
|
|
|
|
|
|
|
|
|
|
|
|
pub static MONERO_FINALITY_CONFIRMATIONS: u32 = 1;
|
|
|
|
pub static MONERO_FINALITY_CONFIRMATIONS: u32 = 1;
|
|
|
|
|
|
|
|
|
|
|
|
pub static MONERO_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(5));
|
|
|
|
pub static MONERO_AVG_BLOCK_TIME: Lazy<Duration> = Lazy::new(|| Duration::from_secs(60));
|
|
|
|
}
|
|
|
|
}
|
|
|
|