mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 10:23:20 -05:00
fix(monero wallet): Check if wallet already exists by JsonRpcError Error Code
This commit is contained in:
parent
e1a053a6fc
commit
80ea9a60a9
1 changed files with 2 additions and 1 deletions
|
|
@ -152,7 +152,8 @@ impl Wallet {
|
||||||
// we just try to open it instead
|
// we just try to open it instead
|
||||||
match result {
|
match result {
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(()),
|
||||||
Err(error) if error.to_string().contains("Wallet already exists") => {
|
// See: https://github.com/monero-project/monero/blob/master/src/wallet/wallet_rpc_server_error_codes.h#L54
|
||||||
|
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError { code: -21, .. })) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
monero_wallet_name = &file_name,
|
monero_wallet_name = &file_name,
|
||||||
"Cannot create wallet because it already exists, loading instead"
|
"Cannot create wallet because it already exists, loading instead"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue