Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Lockfree #3961

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
comments
  • Loading branch information
aeyakovenko committed Apr 20, 2019
commit d1140016687ba12e1d7e3061015912a6627f8b6d
3 changes: 2 additions & 1 deletion runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ impl AccountsDB {
store.remove_account();
}
}
//TODO: performance here could be improved if AccountsDB::storage was organized by fork
let dead_forks: HashSet<Fork> = storage
.values()
.filter_map(|x| {
Expand All @@ -382,6 +383,7 @@ impl AccountsDB {
}
fn cleanup_dead_forks(&self, dead_forks: &mut HashSet<Fork>) {
let mut index = self.accounts_index.write().unwrap();
// a fork is not totally dead until it is older than the root
dead_forks.retain(|fork| *fork < index.last_root);
for fork in dead_forks.iter() {
index.cleanup_dead_fork(*fork);
Expand Down Expand Up @@ -771,7 +773,6 @@ mod tests {
}

#[test]
#[ignore]
fn test_account_grow() {
let paths = get_tmp_accounts_path!();
let accounts = AccountsDB::new(&paths.paths);
Expand Down