From 9f7b79af00a1ed57ab8640636041a81b58ecff59 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 21 Aug 2020 13:27:10 +0200 Subject: [PATCH] eth/downloader: fix rollback issue on short chains --- eth/downloader/downloader.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 83b757fa1..f3b0926d7 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -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