Fix invalidation of anchors (#4292)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
ledgerwatch 2022-05-28 17:33:27 +01:00 committed by GitHub
parent 9d550e37a4
commit 438c3933af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,8 +374,8 @@ func (hd *HeaderDownload) invalidateAnchor(anchor *Anchor, reason string) {
log.Debug("Invalidating anchor", "height", anchor.blockHeight, "hash", anchor.parentHash, "reason", reason)
hd.removeAnchor(anchor)
for child := anchor.fLink; child != nil; child, child.next = child.next, nil {
hd.removeUpwards(child)
}
hd.removeUpwards(anchor.fLink)
}
func (hd *HeaderDownload) RequestMoreHeaders(currentTime uint64) (*HeaderRequest, []PenaltyItem) {