diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 2fdd778adc..7bdb1e42a4 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -685,9 +685,11 @@ impl AccountsIndex { } pub fn get_rooted_entries(&self, slice: SlotSlice, max: Option) -> SlotList { + let max = max.unwrap_or(Slot::MAX); + let lock = &self.roots_tracker.read().unwrap().roots; slice .iter() - .filter(|(slot, _)| self.is_root(*slot) && max.map_or(true, |max| *slot <= max)) + .filter(|(slot, _)| *slot <= max && lock.contains(slot)) .cloned() .collect() }