diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-09 18:45:41 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-06-09 18:45:41 +0800 |
commit | 087949227c3b10c2ae45cb1a54a6de1f4f5d6600 (patch) | |
tree | e9833af8a79a73d50c4142a4d9b4a5a54d990376 /eth/downloader/peer.go | |
parent | 11f65cf885317d6c355b4c4a8d7420bcb82839d1 (diff) | |
parent | 4ed3509a02c7f5a09036e6e9cb615c6def6d25f3 (diff) | |
download | go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar.gz go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar.bz2 go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar.lz go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar.xz go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.tar.zst go-tangerine-087949227c3b10c2ae45cb1a54a6de1f4f5d6600.zip |
Merge pull request #1153 from karalabe/downloader-banned-starvation-attack
eth/downloader: gather and ban hashes from invalid chains
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) { |