From 6208124511c0a30d04c8d8f9b79e1c4d34ac3f96 Mon Sep 17 00:00:00 2001 From: imabdulbasit Date: Tue, 24 Oct 2023 17:31:25 +0500 Subject: [PATCH] err log to output signature for failed get transaction call --- consumer/src/solana.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/consumer/src/solana.rs b/consumer/src/solana.rs index a1ecbee..69d2f06 100644 --- a/consumer/src/solana.rs +++ b/consumer/src/solana.rs @@ -231,7 +231,11 @@ impl Solana { .notify(|err: &ClientError, dur: Duration| { error!("retrying error {:?} in {:?}", err, dur); }) - .await?; + .await + .map_err(|e| { + error!("failed to get transaction for signature {:?}", signature); + e + })?; let meta = response .transaction @@ -335,11 +339,11 @@ impl Solana { if valid_blockhash { tokio::time::sleep(std::time::Duration::from_millis(250)).await; continue; - } else { - let msg = format!("blockhash is invalid: {recent_blockhash}"); - error!(msg); - bail!(msg) } + + let msg = format!("blockhash is invalid: {recent_blockhash}"); + error!(msg); + bail!(msg) }, Some(Err(e)) => { let msg = format!("failed to send transaction: {e}");