mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Merge #1274
1274: fix: add debug log for opening monero wallet error r=delta1 a=delta1 see issue #1273 Co-authored-by: Byron Hambly <bhambly@blockstream.com>
This commit is contained in:
commit
ab5d4a1ed5
@ -26,15 +26,16 @@ impl Wallet {
|
||||
pub async fn open_or_create(url: Url, name: String, env_config: Config) -> Result<Self> {
|
||||
let client = wallet::Client::new(url)?;
|
||||
|
||||
let open_wallet_response = client.open_wallet(name.clone()).await;
|
||||
if open_wallet_response.is_err() {
|
||||
client.create_wallet(name.clone(), "English".to_owned()).await.context(
|
||||
"Unable to create Monero wallet, please ensure that the monero-wallet-rpc is available",
|
||||
)?;
|
||||
match client.open_wallet(name.clone()).await {
|
||||
Err(error) => {
|
||||
tracing::debug!(%error, "Open wallet response error");
|
||||
client.create_wallet(name.clone(), "English".to_owned()).await.context(
|
||||
"Unable to create Monero wallet, please ensure that the monero-wallet-rpc is available",
|
||||
)?;
|
||||
|
||||
tracing::debug!(monero_wallet_name = %name, "Created Monero wallet");
|
||||
} else {
|
||||
tracing::debug!(monero_wallet_name = %name, "Opened Monero wallet");
|
||||
tracing::debug!(monero_wallet_name = %name, "Created Monero wallet");
|
||||
}
|
||||
Ok(_) => tracing::debug!(monero_wallet_name = %name, "Opened Monero wallet"),
|
||||
}
|
||||
|
||||
Self::connect(client, name, env_config).await
|
||||
|
Loading…
Reference in New Issue
Block a user