Revert "account storage is not in sync with the index after gc (#3914)" (#3936)

This reverts commit 101d6b92ee.
This commit is contained in:
Pankaj Garg
2019-04-22 17:14:41 -07:00
committed by GitHub
parent 4b04c37c36
commit 4f47fc00bc
3 changed files with 151 additions and 206 deletions

View File

@@ -9,7 +9,7 @@ pub struct AccountsIndex<T> {
account_maps: HashMap<Pubkey, Vec<(Fork, T)>>,
roots: HashSet<Fork>,
//This value that needs to be stored to recover the index from AppendVec
pub last_root: Fork,
last_root: Fork,
}
impl<T: Clone> AccountsIndex<T> {
@@ -59,7 +59,7 @@ impl<T: Clone> AccountsIndex<T> {
};
rv
}
pub fn is_purged(&self, fork: Fork) -> bool {
fn is_purged(&self, fork: Fork) -> bool {
!self.is_root(fork) && fork < self.last_root
}
pub fn is_root(&self, fork: Fork) -> bool {