From 63b97729e6856be4f3955942ac8087c005ed202e Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 18 May 2021 11:11:38 -0700 Subject: [PATCH] get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level --- client/src/rpc_client.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index 88f006e628a8ed..19585633a6ff27 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -1166,7 +1166,6 @@ impl RpcClient { filters: None, account_config: RpcAccountInfoConfig { encoding: Some(UiAccountEncoding::Base64Zstd), - commitment: Some(self.commitment_config), ..RpcAccountInfoConfig::default() }, }, @@ -1178,7 +1177,10 @@ impl RpcClient { pubkey: &Pubkey, config: RpcProgramAccountsConfig, ) -> ClientResult> { - let commitment = config.account_config.commitment.unwrap_or_default(); + let commitment = config + .account_config + .commitment + .unwrap_or_else(|| self.commitment()); let commitment = self.maybe_map_commitment(commitment)?; let account_config = RpcAccountInfoConfig { commitment: Some(commitment),