don't iterate slot_list if zero-lamport (#16678)

This commit is contained in:
Jeff Washington (jwash)
2021-04-21 20:38:48 -05:00
committed by GitHub
parent 6004c0abf5
commit 123e0bdba7

View File

@ -1570,8 +1570,7 @@ impl AccountsDb {
self.accounts_index
.roots_and_ref_count(&locked_entry, max_clean_root),
);
}
} else {
// prune zero_lamport_pubkey set which should contain all 0-lamport
// keys whether rooted or not. A 0-lamport update may become rooted
// in the future.
@ -1581,6 +1580,7 @@ impl AccountsDb {
if !has_zero_lamport_accounts {
self.accounts_index.remove_zero_lamport_key(pubkey);
}
}
// Release the lock
let slot = *slot;