diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 0a80ad935f..e878c04003 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -755,7 +755,7 @@ impl AccountsIndex { if let Some(ancestors) = ancestors { if !ancestors.is_empty() { for (i, (slot, _t)) in slice.iter().rev().enumerate() { - if *slot >= current_max && ancestors.contains_key(slot) { + if (rv.is_none() || *slot > current_max) && ancestors.contains_key(slot) { rv = Some(i); current_max = *slot; } @@ -767,7 +767,7 @@ impl AccountsIndex { let mut tracker = None; for (i, (slot, _t)) in slice.iter().rev().enumerate() { - if *slot >= current_max && *slot <= max_root { + if (rv.is_none() || *slot > current_max) && *slot <= max_root { let lock = match tracker { Some(inner) => inner, None => self.roots_tracker.read().unwrap(),