mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-04-20 16:06:00 -04:00
Merge 828038949521fa9bb0828ed25046b36d812fabe1 into 81b89d63c28562476d05c5a39c952bfbe2d7c995
This commit is contained in:
commit
24765ea471
@ -36,6 +36,7 @@ pub trait MoneroWalletRpc {
|
||||
async fn refresh(&self) -> Refreshed;
|
||||
async fn sweep_all(&self, address: String) -> SweepAll;
|
||||
async fn get_version(&self) -> Version;
|
||||
async fn store(&self);
|
||||
}
|
||||
|
||||
#[jsonrpc_client::implement(MoneroWalletRpc)]
|
||||
|
@ -466,7 +466,8 @@ async fn init_monero_wallet(
|
||||
env_config,
|
||||
)
|
||||
.await?;
|
||||
|
||||
let _ = wallet.refresh().await?;
|
||||
wallet.store().await?;
|
||||
Ok(wallet)
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,11 @@ impl Wallet {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn store(&self) -> Result<()> {
|
||||
self.inner.lock().await.store().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Close the wallet and open (load) another wallet by generating it from
|
||||
/// keys. The generated wallet will remain loaded.
|
||||
pub async fn create_from_and_load(
|
||||
|
@ -189,6 +189,8 @@ where
|
||||
)
|
||||
})?;
|
||||
|
||||
monero_wallet.store().await?;
|
||||
|
||||
AliceState::XmrLocked {
|
||||
monero_wallet_restore_blockheight,
|
||||
transfer_proof,
|
||||
@ -395,6 +397,8 @@ where
|
||||
)
|
||||
.await?;
|
||||
|
||||
monero_wallet.store().await?;
|
||||
|
||||
AliceState::XmrRefunded
|
||||
}
|
||||
AliceState::BtcPunishable {
|
||||
|
Loading…
x
Reference in New Issue
Block a user