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/handler.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/handler.go')
-rw-r--r-- | eth/handler.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/handler.go b/eth/handler.go index aea33452c..37bbd3691 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -213,8 +213,8 @@ func (self *ProtocolManager) handleMsg(p *peer) error { return errResp(ErrDecode, "->msg %v: %v", msg, err) } - if request.Amount > downloader.MaxHashFetch { - request.Amount = downloader.MaxHashFetch + if request.Amount > uint64(downloader.MaxHashFetch) { + request.Amount = uint64(downloader.MaxHashFetch) } hashes := self.chainman.GetBlockHashesFromHash(request.Hash, request.Amount) |