aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/queue.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-04 19:51:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-06-04 19:51:14 +0800
commit28c32d1b1bc9ed687713aa4de4eaab38d2a4cb08 (patch)
tree3747e7ea7d0a88bcaf604f4fd7870a8b0264f9ae /eth/downloader/queue.go
parent861031491860c69f29e1444c22dd84c38abfedf4 (diff)
downloadgo-tangerine-28c32d1b1bc9ed687713aa4de4eaab38d2a4cb08.tar.gz
go-tangerine-28c32d1b1bc9ed687713aa4de4eaab38d2a4cb08.tar.zst
go-tangerine-28c32d1b1bc9ed687713aa4de4eaab38d2a4cb08.zip
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.go2
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)