mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-14 16:18:52 -05:00
fix(swap): Error handling for fallback during Monero tx monitoring (#278)
This commit is contained in:
parent
80ef31c3e9
commit
7023a186b1
1 changed files with 13 additions and 4 deletions
|
|
@ -376,10 +376,19 @@ async fn wait_for_confirmations_with<
|
||||||
// TODO: Implement this using a generic proxy for each function call once https://github.com/thomaseizinger/rust-jsonrpc-client/issues/47 is fixed.
|
// TODO: Implement this using a generic proxy for each function call once https://github.com/thomaseizinger/rust-jsonrpc-client/issues/47 is fixed.
|
||||||
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError { code: -13, .. })) => {
|
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError { code: -13, .. })) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"Opening wallet `{}` because no wallet is loaded",
|
"No wallet loaded. Opening wallet `{}` to continue monitoring of Monero transaction {}",
|
||||||
wallet_name
|
wallet_name,
|
||||||
|
txid
|
||||||
);
|
);
|
||||||
let _ = client.open_wallet(wallet_name.clone()).await;
|
|
||||||
|
if let Err(err) = client.open_wallet(wallet_name.clone()).await {
|
||||||
|
tracing::warn!(
|
||||||
|
%err,
|
||||||
|
"Failed to open wallet `{}` to continue monitoring of Monero transaction {}",
|
||||||
|
wallet_name,
|
||||||
|
txid
|
||||||
|
);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Err(other) => {
|
Err(other) => {
|
||||||
|
|
@ -576,7 +585,7 @@ mod tests {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
writer.captured(),
|
writer.captured(),
|
||||||
r" INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=1 needed_confirmations=5
|
r" INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=1 needed_confirmations=5
|
||||||
DEBUG swap::monero::wallet: Opening wallet `foo-wallet` because no wallet is loaded
|
DEBUG swap::monero::wallet: No wallet loaded. Opening wallet `foo-wallet` to continue monitoring of Monero transaction <FOO>
|
||||||
INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=3 needed_confirmations=5
|
INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=3 needed_confirmations=5
|
||||||
INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=5 needed_confirmations=5
|
INFO swap::monero::wallet: Received new confirmation for Monero lock tx txid=<FOO> seen_confirmations=5 needed_confirmations=5
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue