diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-05 01:42:34 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-05 01:42:34 +0800 |
commit | 10fc73376789b1b016fbbd86df3b378df0238a0c (patch) | |
tree | aff4fb03c3fdb054bef7ad132e2ce32ff8668698 /eth/downloader/queue.go | |
parent | 861031491860c69f29e1444c22dd84c38abfedf4 (diff) | |
parent | d754c25cc87172dfafeea71116da2260544a3f09 (diff) | |
download | dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar.gz dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar.bz2 dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar.lz dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar.xz dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.tar.zst dexon-10fc73376789b1b016fbbd86df3b378df0238a0c.zip |
Merge pull request #1184 from karalabe/nonstop-block-fetches
eth/downloader: fix #1178, don't request blocks beyond the cache bounds
Diffstat (limited to 'eth/downloader/queue.go')
-rw-r--r-- | eth/downloader/queue.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 69d91512a..02fa667f1 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -225,7 +225,7 @@ func (q *queue) Reserve(p *peer) *fetchRequest { skip := make(map[common.Hash]int) capacity := p.Capacity() - for len(send) < space && len(send) < capacity && !q.hashQueue.Empty() { + for proc := 0; proc < space && len(send) < capacity && !q.hashQueue.Empty(); proc++ { hash, priority := q.hashQueue.Pop() if p.ignored.Has(hash) { skip[hash.(common.Hash)] = int(priority) |