Skip to content

Commit

Permalink
feat: add debugging info for failed to fetch transaction
Browse files Browse the repository at this point in the history
Add the jsonrpc error message and data to tracing calls to try debug comit-network#1061
"monero-wallet-rpc failed to fetch transaction"
  • Loading branch information
delta1 committed Aug 3, 2022
1 parent b7e2e08 commit 7e4af68
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions swap/src/monero/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,13 @@ async fn wait_for_confirmations<C: monero_rpc::wallet::MoneroWalletRpc<reqwest::
.await
{
Ok(proof) => proof,
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError { code: -1, .. })) => {
tracing::warn!(%txid, "`monero-wallet-rpc` failed to fetch transaction, may need to be restarted");
Err(jsonrpc::Error::JsonRpc(jsonrpc::JsonRpcError {
code: -1,
message,
data,
})) => {
tracing::debug!(message, ?data);
tracing::warn!(%txid, message, "`monero-wallet-rpc` failed to fetch transaction, may need to be restarted");
continue;
}
// TODO: Implement this using a generic proxy for each function call once https://github.com/thomaseizinger/rust-jsonrpc-client/issues/47 is fixed.
Expand Down

0 comments on commit 7e4af68

Please sign in to comment.