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

@ -144,18 +144,8 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
}
// TakeBlocks takes blocks from the queue and yields them to the caller.
func (d *Downloader) TakeBlocks() (types.Blocks, error) {
// If the head block is missing, no blocks are ready
head := d.queue.GetHeadBlock()
if head == nil {
return nil, nil
}
// If the parent hash of the head is unknown, notify the caller
if !d.hasBlock(head.ParentHash()) {
return nil, ErrUnknownParent
}
// Otherwise retrieve a full batch of blocks
return d.queue.TakeBlocks(head), nil
func (d *Downloader) TakeBlocks() types.Blocks {
return d.queue.TakeBlocks()
}
func (d *Downloader) Has(hash common.Hash) bool {