eth, eth/downloader: move peer removal into downloader

This commit is contained in:
Péter Szilágyi
2015-06-11 15:56:08 +03:00
parent 6f5c6150b7
commit 66d3dc8690
6 changed files with 83 additions and 82 deletions

View File

@ -320,7 +320,7 @@ func (q *queue) Deliver(id string, blocks []*types.Block) (err error) {
// If a requested block falls out of the range, the hash chain is invalid
index := int(block.NumberU64()) - q.blockOffset
if index >= len(q.blockCache) || index < 0 {
return ErrInvalidChain
return errInvalidChain
}
// Otherwise merge the block and mark the hash block
q.blockCache[index] = &Block{