aboutsummaryrefslogtreecommitdiffstats
path: root/eth/handler.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-05-22 00:00:12 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-05-22 00:00:12 +0800
commitaf28736bd0f01176fa95b715e48476dd8269b942 (patch)
treeeb7d7a47801f5650ae790735f5b48c657ccc7f4c /eth/handler.go
parent1da145675d7975bf99ef0c947cac7eaf5b87f21d (diff)
parent06a041589f3c2d4b3e66a1ce51e3e03e209fdbff (diff)
downloadgo-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar.gz
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar.bz2
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar.lz
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar.xz
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.tar.zst
go-tangerine-af28736bd0f01176fa95b715e48476dd8269b942.zip
Merge pull request #1064 from karalabe/downloader-attacks
Fix two additional download vulnerabilities
Diffstat (limited to 'eth/handler.go')
-rw-r--r--eth/handler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/eth/handler.go b/eth/handler.go
index 8dd254b1a..9117a70de 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -206,8 +206,8 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
return errResp(ErrDecode, "->msg %v: %v", msg, err)
}
- if request.Amount > maxHashes {
- request.Amount = maxHashes
+ if request.Amount > downloader.MaxHashFetch {
+ request.Amount = downloader.MaxHashFetch
}
hashes := self.chainman.GetBlockHashesFromHash(request.Hash, request.Amount)
@@ -254,7 +254,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error {
if block != nil {
blocks = append(blocks, block)
}
- if i == maxBlocks {
+ if i == downloader.MaxBlockFetch {
break
}
}