Skip to content

Commit

Permalink
Simulate tranasctions before sending for better debug when transactio…
Browse files Browse the repository at this point in the history
…ns fail to land
  • Loading branch information
mvines committed Jun 17, 2024
1 parent 9ef66c7 commit 2768188
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use {
solana_clap_utils::input_validators::normalize_to_url_if_moniker,
solana_client::{
rpc_client::{RpcClient, SerializableTransaction},
rpc_config::RpcSendTransactionConfig,
rpc_response,
},
solana_sdk::{clock::Slot, commitment_config::CommitmentConfig},
Expand Down Expand Up @@ -111,11 +110,6 @@ fn send_transaction_until_expired_with_slot(
) -> Option<(Slot, bool)> {
let mut last_send_attempt = None;

let config = RpcSendTransactionConfig {
skip_preflight: true,
..RpcSendTransactionConfig::default()
};

loop {
if last_send_attempt.is_none()
|| Instant::now()
Expand All @@ -129,7 +123,7 @@ fn send_transaction_until_expired_with_slot(
transaction.get_signature()
);

if let Err(err) = rpc_client.send_transaction_with_config(transaction, config) {
if let Err(err) = rpc_client.send_transaction(transaction) {
println!("Unable to send transaction: {err:?}");
}
}
Expand Down

0 comments on commit 2768188

Please sign in to comment.