eth/downloader: fix error aggregator (#27217)

This commit is contained in:
rjl493456442
2023-05-05 08:55:32 +03:00
committed by GitHub
parent ffda2c64c4
commit 79a57d49cb
+5 -2
View File
@@ -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()