From dc8df5c8570976e81463a57ea59471d222f4bd41 Mon Sep 17 00:00:00 2001 From: guagualvcha <296179868@qq.com> Date: Wed, 20 Oct 2021 12:00:40 +0800 Subject: [PATCH] fix download nil issue --- eth/downloader/downloader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 55be200d59..5da80c9d3a 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1028,8 +1028,8 @@ func (d *Downloader) findAncestorBinarySearch(p *peerConnection, mode SyncMode, } header := d.lightchain.GetHeaderByHash(h) // Independent of sync mode, header surely exists if header == nil { - p.log.Error("header not found", "number", header.Number, "hash", header.Hash(), "request", check) - return 0, fmt.Errorf("%w: header no found (%d)", errBadPeer, header.Number) + p.log.Error("header not found", "hash", h, "request", check) + return 0, fmt.Errorf("%w: header no found (%s)", errBadPeer, h) } if header.Number.Uint64() != check { p.log.Warn("Received non requested header", "number", header.Number, "hash", header.Hash(), "request", check)