no need to call AddBlockHashes when receiving new block

This commit is contained in:
zelig 2015-01-09 05:06:04 +00:00
parent 69dfca2feb
commit 43ed0ed1ae

View File

@ -211,16 +211,6 @@ func (self *ethProtocol) handle() error {
// uses AddPeer followed by AddHashes, AddBlock only if peer is the best peer // uses AddPeer followed by AddHashes, AddBlock only if peer is the best peer
// (or selected as new best peer) // (or selected as new best peer)
if self.blockPool.AddPeer(request.TD, hash, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect) { if self.blockPool.AddPeer(request.TD, hash, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect) {
called := true
iter := func() ([]byte, bool) {
if called {
called = false
return hash, true
} else {
return nil, false
}
}
self.blockPool.AddBlockHashes(iter, self.id)
self.blockPool.AddBlock(request.Block, self.id) self.blockPool.AddBlock(request.Block, self.id)
} }