diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index 98349fec88..3f8c612143 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -2965,11 +2965,25 @@ impl RpcClient { &self, pubkeys: &[Pubkey], commitment_config: CommitmentConfig, + ) -> RpcResult>> { + self.get_multiple_accounts_with_config( + pubkeys, + RpcAccountInfoConfig { + encoding: Some(UiAccountEncoding::Base64Zstd), + commitment: Some(self.maybe_map_commitment(commitment_config)?), + data_slice: None, + }, + ) + } + + pub fn get_multiple_accounts_with_config( + &self, + pubkeys: &[Pubkey], + config: RpcAccountInfoConfig, ) -> RpcResult>> { let config = RpcAccountInfoConfig { - encoding: Some(UiAccountEncoding::Base64Zstd), - commitment: Some(self.maybe_map_commitment(commitment_config)?), - data_slice: None, + commitment: config.commitment.or_else(|| Some(self.commitment())), + ..config }; let pubkeys: Vec<_> = pubkeys.iter().map(|pubkey| pubkey.to_string()).collect(); let response = self.send(RpcRequest::GetMultipleAccounts, json!([pubkeys, config]))?;