Skip to content

Commit

Permalink
stage_headers: fix uint underflow at parent request (erigontech#10618) (
Browse files Browse the repository at this point in the history
#482)

Co-authored-by: Alex Sharov <[email protected]>
  • Loading branch information
blxdyx and AskAlexSharov authored Aug 14, 2024
1 parent 49ca397 commit c8bbc3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions turbo/stages/headerdownload/header_algos.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ func (hd *HeaderDownload) RequestMoreHeaders(currentTime time.Time) (*HeaderRequ
var penalties []PenaltyItem
var req *HeaderRequest
hd.anchorTree.Ascend(func(anchor *Anchor) bool {
if anchor.blockHeight == 0 { //has no parent
return true
}
if anchor.nextRetryTime.After(currentTime) {
// We are not ready to retry this anchor yet
dataflow.HeaderDownloadStates.AddChange(anchor.blockHeight-1, dataflow.HeaderRetryNotReady)
Expand Down

0 comments on commit c8bbc3d

Please sign in to comment.