From c46a29340dc4c6512d52b4fcb7f629aeb6ed3da2 Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Tue, 24 May 2022 14:34:26 +0530 Subject: [PATCH] handle all errors --- eth/downloader/downloader.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 4420ca2c1b..12b4a90dde 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -797,8 +797,7 @@ func (d *Downloader) getFetchHeadersByNumber(p *peerConnection) func(number uint // the head links match), we do a binary search to find the common ancestor. func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header) (uint64, error) { // Check the validity of chain to be downloaded - // TODO: we can use a mock and - if _, err := d.IsValidChain(remoteHeader, d.getFetchHeadersByNumber(p)); errors.Is(err, whitelist.ErrCheckpointMismatch) { + if _, err := d.IsValidChain(remoteHeader, d.getFetchHeadersByNumber(p)); err != nil { return 0, err }