Skip to content

Commit

Permalink
Merge pull request #96 from holaplex/abdul/rm-skip-preflight
Browse files Browse the repository at this point in the history
send transaction without config
  • Loading branch information
imabdulbasit authored Oct 24, 2023
2 parents c2c4ba6 + 4fcea98 commit ed98c67
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions consumer/src/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,31 +297,25 @@ impl Solana {
message,
};

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 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 recent_blockhash = transaction.get_recent_blockhash();

Expand Down

0 comments on commit ed98c67

Please sign in to comment.