mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-02 14:22:55 +00:00
eth/downloader: exit loop when there is no more available task
This commit is contained in:
parent
6ca59d98f8
commit
02aa86e659
1 changed files with 4 additions and 0 deletions
|
|
@ -1093,6 +1093,10 @@ func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliv
|
||||||
throttled = true
|
throttled = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
// Short circuit if there is no more available task.
|
||||||
|
if pending() == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
// Reserve a chunk of fetches for a peer. A nil can mean either that
|
// Reserve a chunk of fetches for a peer. A nil can mean either that
|
||||||
// no more headers are available, or that the peer is known not to
|
// no more headers are available, or that the peer is known not to
|
||||||
// have them.
|
// have them.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue