From 79a57d49cb670c56dbc279d022bf4845b960566e Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Fri, 5 May 2023 13:55:32 +0800 Subject: [PATCH] eth/downloader: fix error aggregator (#27217) --- eth/downloader/downloader.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index e56321e58..9a805396c 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -663,8 +663,11 @@ func (d *Downloader) spawnSync(fetchers []func() error) error { // it has processed the queue. d.queue.Close() } - if err = <-errc; err != nil && err != errCanceled { - break + if got := <-errc; got != nil { + err = got + if got != errCanceled { + break // receive a meaningful error, bubble it up + } } } d.queue.Close()