eth/downloader: fix premature exit before notifying all part fetchers

This commit is contained in:
Péter Szilágyi 2016-02-29 14:22:28 +02:00
parent 4e7abcff30
commit 64ee5763ee
1 changed files with 3 additions and 1 deletions

View File

@ -1263,9 +1263,11 @@ func (d *Downloader) fetchHeaders(p *peer, td *big.Int, from uint64) error {
case ch <- false: case ch <- false:
case <-d.cancelCh: case <-d.cancelCh:
} }
return nil
} }
} }
if !cont {
return nil
}
// Queue not yet full, fetch the next batch // Queue not yet full, fetch the next batch
from += uint64(len(headers)) from += uint64(len(headers))
getHeaders(from) getHeaders(from)