diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index fa42c528d29e73..6a327978149532 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -8533,6 +8533,7 @@ impl AccountsDb { .storage .iter() .map(|k| *k.key() as Slot) + .filter(|slot| requested_slots.contains(slot)) .collect::>(); m.stop(); let mut m2 = Measure::start("filter"); @@ -8545,11 +8546,10 @@ impl AccountsDb { slots .iter() .filter_map(|slot| { - if requested_slots.contains(slot) - && (self.accounts_index.is_alive_root(*slot) - || ancestors - .map(|ancestors| ancestors.contains_key(slot)) - .unwrap_or_default()) + if self.accounts_index.is_alive_root(*slot) + || ancestors + .map(|ancestors| ancestors.contains_key(slot)) + .unwrap_or_default() { self.storage.get(slot).map_or_else( || None,