File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -739,9 +739,11 @@ func (d *Downloader) fetchBlocks61(from uint64) error {
739
739
break
740
740
}
741
741
// Send a download request to all idle peers, until throttled
742
+ throttled := false
742
743
for _ , peer := range d .peers .IdlePeers () {
743
744
// Short circuit if throttling activated
744
745
if d .queue .Throttle () {
746
+ throttled = true
745
747
break
746
748
}
747
749
// 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 {
762
764
}
763
765
// Make sure that we have peers available for fetching. If all peers have been tried
764
766
// and all failed throw an error
765
- if ! d . queue . Throttle () && d .queue .InFlight () == 0 {
767
+ if ! throttled && d .queue .InFlight () == 0 {
766
768
return errPeersUnavailable
767
769
}
768
770
}
You can’t perform that action at this time.
0 commit comments