From 1952368e51b41ff8271d0eba43a30855fb3f2f8f Mon Sep 17 00:00:00 2001 From: Keyvan Khademi Date: Thu, 5 Dec 2024 05:48:15 -0800 Subject: [PATCH] fix(cli): get finalized block hash (#543) --- staking/cli/src/instructions.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/staking/cli/src/instructions.rs b/staking/cli/src/instructions.rs index 83a575e7..e6908dfe 100644 --- a/staking/cli/src/instructions.rs +++ b/staking/cli/src/instructions.rs @@ -252,7 +252,13 @@ pub fn process_transaction( signers: &[&dyn Signer], ) -> Result { let mut transaction = Transaction::new_with_payer(instructions, Some(&signers[0].pubkey())); - transaction.sign(signers, rpc_client.get_latest_blockhash().unwrap()); + transaction.sign( + signers, + rpc_client + .get_latest_blockhash_with_commitment(CommitmentConfig::finalized()) + .unwrap() + .0, + ); let transaction_signature_res = rpc_client .send_and_confirm_transaction_with_spinner_and_config( &transaction,