From 64ee5763eebe7e57e761be840f0b80ed7be93ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 29 Feb 2016 14:22:28 +0200 Subject: [PATCH] eth/downloader: fix premature exit before notifying all part fetchers --- eth/downloader/downloader.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 017d257048..143d8bde70 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1263,9 +1263,11 @@ func (d *Downloader) fetchHeaders(p *peer, td *big.Int, from uint64) error { case ch <- false: case <-d.cancelCh: } - return nil } } + if !cont { + return nil + } // Queue not yet full, fetch the next batch from += uint64(len(headers)) getHeaders(from)