eth/downloader: cap the hash ban set, add test for it

This commit is contained in:
Péter Szilágyi
2015-06-08 14:06:36 +03:00
parent 4b2dd44711
commit 63c6cedb14
6 changed files with 64 additions and 12 deletions

View File

@ -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)