Merge pull request #21472 from holiman/fix_dltest_fail

eth/downloader: fix rollback issue on short chains
This commit is contained in:
Péter Szilágyi 2020-08-21 14:43:14 +03:00 committed by GitHub
commit b68929caee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -1502,6 +1502,8 @@ func (d *Downloader) processHeaders(origin uint64, pivot uint64, td *big.Int) er
head := chunk[len(chunk)-1].Number.Uint64()
if head-rollback > uint64(fsHeaderSafetyNet) {
rollback = head - uint64(fsHeaderSafetyNet)
} else {
rollback = 1
}
}
// Unless we're doing light chains, schedule the headers for associated content retrieval