Skip to content

Commit b68929c

Browse files
authored
Merge pull request #21472 from holiman/fix_dltest_fail
eth/downloader: fix rollback issue on short chains
2 parents 4e54b1a + 9f7b79a commit b68929c

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)