Co-authored-by: Carl <carl@solana.com>
This commit is contained in:
carllin 2020-05-06 11:44:49 -07:00 committed by GitHub
parent 766062b2cc
commit 445e6668c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -496,10 +496,14 @@ impl ReplayStage {
bank_forks: &RwLock<BankForks>,
) {
error!("purging slot {}", duplicate_slot);
let empty = HashSet::new();
let slot_descendants = descendants.get(&duplicate_slot).unwrap_or(&empty);
let slot_descendants = descendants.get(&duplicate_slot);
if slot_descendants.is_none() {
// Root has already moved past this slot, no need to purge it
return;
}
for d in slot_descendants
.unwrap()
.iter()
.chain(std::iter::once(&duplicate_slot))
{