Merge 828038949521fa9bb0828ed25046b36d812fabe1 into 81b89d63c28562476d05c5a39c952bfbe2d7c995

This commit is contained in:
pokkst 2024-11-20 16:28:56 +02:00 committed by GitHub
commit 24765ea471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -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)]

View File

@ -466,7 +466,8 @@ async fn init_monero_wallet(
env_config,
)
.await?;
let _ = wallet.refresh().await?;
wallet.store().await?;
Ok(wallet)
}

View File

@ -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(

View File

@ -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 {