From 544b9e2fa5a3ceb463b47dc6229c07711ab4b4f8 Mon Sep 17 00:00:00 2001 From: Abdul Basit <45506001+imabdulbasit@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:05:57 +0500 Subject: [PATCH] Revert "send transaction without config" --- consumer/src/solana.rs | 44 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/consumer/src/solana.rs b/consumer/src/solana.rs index e2c1982..69d2f06 100644 --- a/consumer/src/solana.rs +++ b/consumer/src/solana.rs @@ -297,25 +297,31 @@ impl Solana { message, }; - let signature = with_retry!(self.rpc().send_transaction(&transaction)) - .when(|e| { - !matches!( - e.kind, - ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_) - ) - }) - .notify(|err: &ClientError, dur: Duration| { - error!( - "failed to send transaction retrying error {:?} in {:?}", - err, dur - ); - }) - .await - .map_err(|e| { - let msg = format!("failed to send transaction: {e}"); - error!(msg); - anyhow!(msg) - })?; + let signature = with_retry!(self.rpc().send_transaction_with_config( + &transaction, + RpcSendTransactionConfig { + skip_preflight: true, + ..Default::default() + } + )) + .when(|e| { + !matches!( + e.kind, + ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_) + ) + }) + .notify(|err: &ClientError, dur: Duration| { + error!( + "failed to send transaction retrying error {:?} in {:?}", + err, dur + ); + }) + .await + .map_err(|e| { + let msg = format!("failed to send transaction: {e}"); + error!(msg); + anyhow!(msg) + })?; let recent_blockhash = transaction.get_recent_blockhash();