mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-25 15:39:25 -05:00
Remove possible mix up of timelocks when using State0::new
This commit is contained in:
parent
f35ed436ce
commit
530b9b2ea8
@ -178,8 +178,7 @@ impl Builder {
|
|||||||
let state0 = State0::new(
|
let state0 = State0::new(
|
||||||
amounts.btc,
|
amounts.btc,
|
||||||
amounts.xmr,
|
amounts.xmr,
|
||||||
self.execution_params.bitcoin_cancel_timelock,
|
self.execution_params,
|
||||||
self.execution_params.bitcoin_punish_timelock,
|
|
||||||
self.bitcoin_wallet.as_ref(),
|
self.bitcoin_wallet.as_ref(),
|
||||||
&mut OsRng,
|
&mut OsRng,
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,7 @@ use crate::{
|
|||||||
wait_for_cancel_timelock_to_expire, GetBlockHeight, TransactionBlockHeight, TxCancel,
|
wait_for_cancel_timelock_to_expire, GetBlockHeight, TransactionBlockHeight, TxCancel,
|
||||||
TxRefund, WatchForRawTransaction,
|
TxRefund, WatchForRawTransaction,
|
||||||
},
|
},
|
||||||
|
execution_params::ExecutionParams,
|
||||||
monero,
|
monero,
|
||||||
protocol::{
|
protocol::{
|
||||||
alice::{Message1, Message3, TransferProof},
|
alice::{Message1, Message3, TransferProof},
|
||||||
@ -104,8 +105,7 @@ impl State0 {
|
|||||||
pub async fn new<R>(
|
pub async fn new<R>(
|
||||||
btc: bitcoin::Amount,
|
btc: bitcoin::Amount,
|
||||||
xmr: monero::Amount,
|
xmr: monero::Amount,
|
||||||
cancel_timelock: Timelock,
|
execution_params: ExecutionParams,
|
||||||
punish_timelock: Timelock,
|
|
||||||
bitcoin_wallet: &bitcoin::Wallet,
|
bitcoin_wallet: &bitcoin::Wallet,
|
||||||
rng: &mut R,
|
rng: &mut R,
|
||||||
) -> Result<Self>
|
) -> Result<Self>
|
||||||
@ -128,8 +128,8 @@ impl State0 {
|
|||||||
punish_address,
|
punish_address,
|
||||||
btc,
|
btc,
|
||||||
xmr,
|
xmr,
|
||||||
cancel_timelock,
|
cancel_timelock: execution_params.bitcoin_cancel_timelock,
|
||||||
punish_timelock,
|
punish_timelock: execution_params.bitcoin_punish_timelock,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user