AcctIdx: items needs to load from disk (#20138)

This commit is contained in:
Jeff Washington (jwash) 2021-09-23 17:33:54 -05:00 committed by GitHub
parent a70fd8e606
commit 2ae1e80013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -83,6 +83,8 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
where
R: RangeBounds<Pubkey> + std::fmt::Debug,
{
self.start_stop_flush(true);
self.put_range_in_cache(range); // check range here to see if our items are already held in the cache
Self::update_stat(&self.stats().items, 1);
let map = self.map().read().unwrap();
let mut result = Vec::with_capacity(map.len());
@ -91,6 +93,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
result.push((*k, v.clone()));
}
});
self.start_stop_flush(false);
result
}