diff --git a/swap/src/protocol/alice.rs b/swap/src/protocol/alice.rs index b35f167e..cf9b883b 100644 --- a/swap/src/protocol/alice.rs +++ b/swap/src/protocol/alice.rs @@ -178,8 +178,7 @@ impl Builder { let state0 = State0::new( amounts.btc, amounts.xmr, - self.execution_params.bitcoin_cancel_timelock, - self.execution_params.bitcoin_punish_timelock, + self.execution_params, self.bitcoin_wallet.as_ref(), &mut OsRng, ) diff --git a/swap/src/protocol/alice/state.rs b/swap/src/protocol/alice/state.rs index 0ec03f05..7127ba36 100644 --- a/swap/src/protocol/alice/state.rs +++ b/swap/src/protocol/alice/state.rs @@ -6,6 +6,7 @@ use crate::{ wait_for_cancel_timelock_to_expire, GetBlockHeight, TransactionBlockHeight, TxCancel, TxRefund, WatchForRawTransaction, }, + execution_params::ExecutionParams, monero, protocol::{ alice::{Message1, Message3, TransferProof}, @@ -104,8 +105,7 @@ impl State0 { pub async fn new( btc: bitcoin::Amount, xmr: monero::Amount, - cancel_timelock: Timelock, - punish_timelock: Timelock, + execution_params: ExecutionParams, bitcoin_wallet: &bitcoin::Wallet, rng: &mut R, ) -> Result @@ -128,8 +128,8 @@ impl State0 { punish_address, btc, xmr, - cancel_timelock, - punish_timelock, + cancel_timelock: execution_params.bitcoin_cancel_timelock, + punish_timelock: execution_params.bitcoin_punish_timelock, }) }