use cheaper account get (#16682)

This commit is contained in:
Jeff Washington (jwash)
2021-04-22 12:54:08 -05:00
committed by GitHub
parent be4df39a4c
commit 8d9d6b62d9

View File

@ -1879,7 +1879,7 @@ impl AccountsDb {
stored_accounts
.iter()
.filter(|(pubkey, stored_account)| {
if let Some((locked_entry, _)) = self.accounts_index.get(pubkey, None, None) {
if let Some(locked_entry) = self.accounts_index.get_account_read_entry(pubkey) {
let is_alive = locked_entry.slot_list().iter().any(|(_slot, i)| {
i.store_id == stored_account.store_id
&& i.offset == stored_account.account.offset
@ -5117,7 +5117,7 @@ impl AccountsDb {
offset,
..
} = stored_account;
if let Some((locked_entry, _)) = self.accounts_index.get(pubkey, None, None) {
if let Some(locked_entry) = self.accounts_index.get_account_read_entry(pubkey) {
let is_alive = locked_entry
.slot_list()
.iter()