From dcd548aea377773725f5199a1d8cc4efb36f74b1 Mon Sep 17 00:00:00 2001 From: keyvan Date: Wed, 4 Dec 2024 16:08:41 -0800 Subject: [PATCH] fix(cli): get finalized block hash --- 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,