diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-08 19:06:36 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-08 19:12:00 +0800 |
commit | 63c6cedb14cbd461733e33ffac016dc7d8e431ae (patch) | |
tree | a1593178989ed92561b37dceb90fbf7401af4b10 /eth/downloader/peer.go | |
parent | 4b2dd44711a04c639ecde68806455ccf7244acce (diff) | |
download | go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar.gz go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar.bz2 go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar.lz go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar.xz go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.tar.zst go-tangerine-63c6cedb14cbd461733e33ffac016dc7d8e431ae.zip |
eth/downloader: cap the hash ban set, add test for it
Diffstat (limited to 'eth/downloader/peer.go')
-rw-r--r-- | eth/downloader/peer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 5fbc64648..9614a6951 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -94,7 +94,7 @@ func (p *peer) SetIdle() { for { // Calculate the new download bandwidth allowance prev := atomic.LoadInt32(&p.capacity) - next := int32(math.Max(1, math.Min(MaxBlockFetch, float64(prev)*scale))) + next := int32(math.Max(1, math.Min(float64(MaxBlockFetch), float64(prev)*scale))) // Try to update the old value if atomic.CompareAndSwapInt32(&p.capacity, prev, next) { |