eth, eth/downloader: remove parent verification from the downlaoder

This commit is contained in:
Péter Szilágyi
2015-05-14 15:38:49 +03:00
parent a4246c2da6
commit 3eda70c64c
4 changed files with 17 additions and 46 deletions

View File

@ -172,17 +172,11 @@ func (q *queue) GetBlock(hash common.Hash) *types.Block {
}
// TakeBlocks retrieves and permanently removes a batch of blocks from the cache.
// The head parameter is required to prevent a race condition where concurrent
// takes may fail parent verifications.
func (q *queue) TakeBlocks(head *types.Block) types.Blocks {
func (q *queue) TakeBlocks() types.Blocks {
q.lock.Lock()
defer q.lock.Unlock()
// Short circuit if the head block's different
if len(q.blockCache) == 0 || q.blockCache[0] != head {
return nil
}
// Otherwise accumulate all available blocks
// Accumulate all available blocks
var blocks types.Blocks
for _, block := range q.blockCache {
if block == nil {