Skip to content

Commit

Permalink
no retry if blockhash not found
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Oct 11, 2023
1 parent 5e6a23b commit 9cb5ddd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions consumer/src/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use mpl_token_metadata::{
use solana_client::{
client_error::{ClientError, ClientErrorKind},
rpc_client::RpcClient as SolanaRpcClient,
rpc_request::RpcError,
};
use solana_program::{
instruction::Instruction, program_pack::Pack, pubkey::Pubkey,
Expand Down Expand Up @@ -270,12 +271,12 @@ impl Solana {
};

let signature = with_retry!(self.rpc().send_transaction(&transaction))
.when(|e| {
!matches!(
e.kind,
ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_)
)
})
.when(|e| {
matches!(e.kind, ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_)| ClientErrorKind::RpcError(RpcError::RpcResponseError {
data: solana_client::rpc_request::RpcResponseErrorData::SendTransactionPreflightFailure(_),
..
}))
})
.call()
.map_err(|e| {
let msg = format!("failed to send transaction: {e}");
Expand Down

0 comments on commit 9cb5ddd

Please sign in to comment.