aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/queue.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-14 20:38:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-14 20:38:49 +0800
commit3eda70c64c3b790573751227f8ac0fe42bdc0307 (patch)
treea5f402ea615e2484bf405f845b77ecd229a5842f /eth/downloader/queue.go
parenta4246c2da658d9b5b02a4caba511688748a88b19 (diff)
downloadgo-tangerine-3eda70c64c3b790573751227f8ac0fe42bdc0307.tar.gz
go-tangerine-3eda70c64c3b790573751227f8ac0fe42bdc0307.tar.zst
go-tangerine-3eda70c64c3b790573751227f8ac0fe42bdc0307.zip
eth, eth/downloader: remove parent verification from the downlaoder
Diffstat (limited to 'eth/downloader/queue.go')
-rw-r--r--eth/downloader/queue.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go
index 40749698c..6ad915757 100644
--- a/eth/downloader/queue.go
+++ b/eth/downloader/queue.go
@@ -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 {