add _inclusive (#27336)

add _inclusive, rename slot
This commit is contained in:
Jeff Washington (jwash) 2022-08-23 14:18:55 -05:00 committed by GitHub
parent deb13abb1f
commit 7f4dc496ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -1413,17 +1413,17 @@ impl<T: IndexValue> AccountsIndex<T> {
fn get_newest_root_in_slot_list(
alive_roots: &RollingBitField,
slice: SlotSlice<T>,
max_allowed_root: Option<Slot>,
max_allowed_root_inclusive: Option<Slot>,
) -> Slot {
let mut max_root = 0;
for (f, _) in slice.iter() {
if let Some(max_allowed_root) = max_allowed_root {
if *f > max_allowed_root {
for (slot, _) in slice.iter() {
if let Some(max_allowed_root_inclusive) = max_allowed_root_inclusive {
if *slot > max_allowed_root_inclusive {
continue;
}
}
if *f > max_root && alive_roots.contains(f) {
max_root = *f;
if *slot > max_root && alive_roots.contains(slot) {
max_root = *slot;
}
}
max_root