mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-26 10:46:23 -05:00
Use macro-based JSON-RPC client
This commit is contained in:
parent
b46dbd738d
commit
6d06db3259
15 changed files with 435 additions and 846 deletions
|
|
@ -197,21 +197,24 @@ async fn next_state(
|
|||
BobState::BtcRedeemed(state) => {
|
||||
let (spend_key, view_key) = state.xmr_keys();
|
||||
|
||||
let generated_wallet_file_name = &swap_id.to_string();
|
||||
if monero_wallet
|
||||
let generated_wallet_file_name = swap_id.to_string();
|
||||
if let Err(e) = monero_wallet
|
||||
.create_from_and_load(
|
||||
generated_wallet_file_name,
|
||||
generated_wallet_file_name.clone(),
|
||||
spend_key,
|
||||
view_key,
|
||||
state.monero_wallet_restore_blockheight,
|
||||
)
|
||||
.await
|
||||
.is_err()
|
||||
{
|
||||
// In case we failed to refresh/sweep, when resuming the wallet might already
|
||||
// exist! This is a very unlikely scenario, but if we don't take care of it we
|
||||
// might not be able to ever transfer the Monero.
|
||||
tracing::warn!("Failed to generate monero wallet from keys, falling back to trying to open the the wallet if it already exists: {}", swap_id);
|
||||
tracing::warn!("Failed to generate monero wallet from keys: {:#}", e);
|
||||
tracing::info!(
|
||||
"Falling back to trying to open the the wallet if it already exists: {}",
|
||||
swap_id
|
||||
);
|
||||
monero_wallet.open(generated_wallet_file_name).await?;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue