Skip to content

Commit

Permalink
v1.18: cli: use newer blockhashes when deploying large programs (back…
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 26, 2024
1 parent 12d55d9 commit c8e6fd0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions client/src/send_and_confirm_transactions_in_parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,18 @@ async fn sign_all_messages_and_send<T: Signers + ?Sized>(
// send all the transaction messages
for (counter, (index, message)) in messages_with_index.iter().enumerate() {
let mut transaction = Transaction::new_unsigned(message.clone());
let blockhashdata = *context.blockhash_data_rw.read().await;

// we have already checked if all transactions are signable.
transaction
.try_sign(signers, blockhashdata.blockhash)
.expect("Transaction should be signable");
let serialized_transaction = serialize(&transaction).expect("Transaction should serialize");
let signature = transaction.signatures[0];
futures.push(async move {
tokio::time::sleep(SEND_INTERVAL.saturating_mul(counter as u32)).await;
let blockhashdata = *context.blockhash_data_rw.read().await;

// we have already checked if all transactions are signable.
transaction
.try_sign(signers, blockhashdata.blockhash)
.expect("Transaction should be signable");
let serialized_transaction =
serialize(&transaction).expect("Transaction should serialize");
let signature = transaction.signatures[0];

// send to confirm the transaction
context.unconfirmed_transaction_map.insert(
signature,
Expand Down

0 comments on commit c8e6fd0

Please sign in to comment.