good morning!!!!

Skip to content
Snippets Groups Projects
Commit e2d7c1a5 authored by Felix Lange's avatar Felix Lange
Browse files

Merge pull request #1752 from karalabe/fix-eth61-test

eth/downloader: fix race causing occasional test failure
parents ebbe25ee 1f1d73ab
No related branches found
No related tags found
No related merge requests found
......@@ -739,9 +739,11 @@ func (d *Downloader) fetchBlocks61(from uint64) error {
break
}
// Send a download request to all idle peers, until throttled
throttled := false
for _, peer := range d.peers.IdlePeers() {
// Short circuit if throttling activated
if d.queue.Throttle() {
throttled = true
break
}
// Reserve a chunk of hashes for a peer. A nil can mean either that
......@@ -762,7 +764,7 @@ func (d *Downloader) fetchBlocks61(from uint64) error {
}
// Make sure that we have peers available for fetching. If all peers have been tried
// and all failed throw an error
if !d.queue.Throttle() && d.queue.InFlight() == 0 {
if !throttled && d.queue.InFlight() == 0 {
return errPeersUnavailable
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment