mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-24 14:15:55 -04:00
Merge 8280389495
into dc6ba84bbb
This commit is contained in:
commit
06d34b7fff
4 changed files with 12 additions and 1 deletions
|
@ -36,6 +36,7 @@ pub trait MoneroWalletRpc {
|
||||||
async fn refresh(&self) -> Refreshed;
|
async fn refresh(&self) -> Refreshed;
|
||||||
async fn sweep_all(&self, address: String) -> SweepAll;
|
async fn sweep_all(&self, address: String) -> SweepAll;
|
||||||
async fn get_version(&self) -> Version;
|
async fn get_version(&self) -> Version;
|
||||||
|
async fn store(&self);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[jsonrpc_client::implement(MoneroWalletRpc)]
|
#[jsonrpc_client::implement(MoneroWalletRpc)]
|
||||||
|
|
|
@ -466,7 +466,8 @@ async fn init_monero_wallet(
|
||||||
env_config,
|
env_config,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
let _ = wallet.refresh().await?;
|
||||||
|
wallet.store().await?;
|
||||||
Ok(wallet)
|
Ok(wallet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,11 @@ impl Wallet {
|
||||||
Ok(())
|
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
|
/// Close the wallet and open (load) another wallet by generating it from
|
||||||
/// keys. The generated wallet will remain loaded.
|
/// keys. The generated wallet will remain loaded.
|
||||||
pub async fn create_from_and_load(
|
pub async fn create_from_and_load(
|
||||||
|
|
|
@ -189,6 +189,8 @@ where
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
monero_wallet.store().await?;
|
||||||
|
|
||||||
AliceState::XmrLocked {
|
AliceState::XmrLocked {
|
||||||
monero_wallet_restore_blockheight,
|
monero_wallet_restore_blockheight,
|
||||||
transfer_proof,
|
transfer_proof,
|
||||||
|
@ -395,6 +397,8 @@ where
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
monero_wallet.store().await?;
|
||||||
|
|
||||||
AliceState::XmrRefunded
|
AliceState::XmrRefunded
|
||||||
}
|
}
|
||||||
AliceState::BtcPunishable {
|
AliceState::BtcPunishable {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue