diff --git a/monero-rpc/src/rpc/wallet.rs b/monero-rpc/src/rpc/wallet.rs index bd44cede..db106cbc 100644 --- a/monero-rpc/src/rpc/wallet.rs +++ b/monero-rpc/src/rpc/wallet.rs @@ -147,7 +147,7 @@ impl Client { Ok(()) } - /// Opens a wallet using `filename`. + /// Close the currently opened wallet, after trying to save it. pub async fn close_wallet(&self) -> Result<()> { let request = Request::new("close_wallet", ""); diff --git a/swap/src/protocol/alice/steps.rs b/swap/src/protocol/alice/steps.rs index 7fb0e57d..aab80944 100644 --- a/swap/src/protocol/alice/steps.rs +++ b/swap/src/protocol/alice/steps.rs @@ -22,7 +22,6 @@ use futures::{ }; use libp2p::PeerId; use sha2::Sha256; -use std::sync::Arc; use tokio::time::timeout; // TODO(Franck): Use helper functions from xmr-btc instead of re-writing them @@ -52,7 +51,7 @@ pub async fn lock_xmr( bob_peer_id: PeerId, state3: alice::State3, event_loop_handle: &mut EventLoopHandle, - monero_wallet: Arc, + monero_wallet: &monero::Wallet, ) -> Result<()> { let S_a = monero::PublicKey::from_private_key(&monero::PrivateKey { scalar: state3.s_a }); @@ -126,14 +125,13 @@ pub async fn publish_cancel_transaction( B: bitcoin::PublicKey, cancel_timelock: CancelTimelock, tx_cancel_sig_bob: bitcoin::Signature, - bitcoin_wallet: Arc, + bitcoin_wallet: &bitcoin::Wallet, ) -> Result { // First wait for cancel timelock to expire let tx_lock_height = bitcoin_wallet .transaction_block_height(tx_lock.txid()) .await?; - poll_until_block_height_is_gte(bitcoin_wallet.as_ref(), tx_lock_height + cancel_timelock) - .await?; + poll_until_block_height_is_gte(&bitcoin_wallet, tx_lock_height + cancel_timelock).await?; let tx_cancel = bitcoin::TxCancel::new(&tx_lock, cancel_timelock, a.public(), B); diff --git a/swap/src/protocol/alice/swap.rs b/swap/src/protocol/alice/swap.rs index f5182227..c9bd7341 100644 --- a/swap/src/protocol/alice/swap.rs +++ b/swap/src/protocol/alice/swap.rs @@ -130,7 +130,7 @@ async fn run_until_internal( bob_peer_id, *state3.clone(), &mut event_loop_handle, - monero_wallet.clone(), + &monero_wallet, ) .await?; @@ -286,7 +286,7 @@ async fn run_until_internal( state3.B, state3.cancel_timelock, state3.tx_cancel_sig_bob.clone(), - bitcoin_wallet.clone(), + &bitcoin_wallet, ) .await?;