From 9c4bf981eb7c6e9098ea06ada36ea328f179b58b Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Wed, 19 Dec 2018 21:39:25 +0100 Subject: [PATCH] downloader: documentation Co-Authored-By: holiman --- eth/downloader/downloader.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index b6f5760d9c..4db689f73b 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1491,6 +1491,10 @@ func (d *Downloader) importBlockResults(results []*fetchResult) error { if index < len(results) { log.Debug("Downloaded item processing failed", "number", results[index].Header.Number, "hash", results[index].Header.Hash(), "err", err) } else { + // The InsertChain method in blockchain.go will sometimes return an out-of-bounds index, + // when it needs to preprocess blocks to import a sidechain. + // The importer will put together a new list of blocks to import, which is a superset + // of the blocks delivered from the downloader, and the indexing will be off. log.Debug("Downloaded item processing failed on sidechain import", "index", index, "err", err) } return errInvalidChain