From 7ba3e710d396bc5e6cd5df58a255c46be78112bd Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 12 Apr 2021 09:52:24 -0600 Subject: [PATCH] latest_slot uses > current_max (#16374) --- runtime/src/accounts_index.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 0a80ad935..e878c0400 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(),