aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/downloader.go
diff options
context:
space:
mode:
Diffstat (limited to 'eth/downloader/downloader.go')
-rw-r--r--eth/downloader/downloader.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index 85de78ebf..cc75c3014 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -150,16 +150,9 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
return d.syncWithPeer(p, hash)
}
-// TakeBlocks takes blocks from the queue and yields them to the blockTaker handler
-// it's possible it yields no blocks
+// TakeBlocks takes blocks from the queue and yields them to the caller.
func (d *Downloader) TakeBlocks() types.Blocks {
- // Check that there are blocks available and its parents are known
- head := d.queue.GetHeadBlock()
- if head == nil || !d.hasBlock(head.ParentHash()) {
- return nil
- }
- // Retrieve a full batch of blocks
- return d.queue.TakeBlocks(head)
+ return d.queue.TakeBlocks()
}
func (d *Downloader) Has(hash common.Hash) bool {