diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 90428c3e5d..c4dec064bf 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -60,7 +60,7 @@ impl AccountsIndex { rv } pub fn is_purged(&self, fork: Fork) -> bool { - !self.is_root(fork) && fork < self.last_root + fork < self.last_root } pub fn is_root(&self, fork: Fork) -> bool { self.roots.contains(&fork) @@ -152,6 +152,8 @@ mod tests { assert!(!index.is_purged(0)); index.add_root(1); assert!(index.is_purged(0)); + index.add_root(2); + assert!(index.is_purged(1)); } #[test]