Skip to content

Commit 9f7b79a

Browse files
committed
eth/downloader: fix rollback issue on short chains
1 parent a70a79b commit 9f7b79a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eth/downloader/downloader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,8 @@ func (d *Downloader) processHeaders(origin uint64, pivot uint64, td *big.Int) er
15021502
head := chunk[len(chunk)-1].Number.Uint64()
15031503
if head-rollback > uint64(fsHeaderSafetyNet) {
15041504
rollback = head - uint64(fsHeaderSafetyNet)
1505+
} else {
1506+
rollback = 1
15051507
}
15061508
}
15071509
// Unless we're doing light chains, schedule the headers for associated content retrieval

0 commit comments

Comments
 (0)