Skip to content

Commit

Permalink
eth/catalyst: when forgetting bad hashes, also forget descendants
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Jul 25, 2022
1 parent 001a93f commit 7d94ebf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ func (api *ConsensusAPI) checkInvalidAncestor(check common.Hash, head common.Has
if api.invalidBlocksHits[badHash] >= invalidBlockHitEviction {
log.Warn("Too many bad block import attempt, trying", "number", invalid.Number, "hash", badHash)
delete(api.invalidBlocksHits, badHash)

for descendant, badHeader := range api.invalidTipsets {
if badHeader.Hash() == badHash {
delete(api.invalidTipsets, descendant)
}
}
return nil
}
// Not too many failures yet, mark the head of the invalid chain as invalid
Expand Down

0 comments on commit 7d94ebf

Please sign in to comment.