aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eth/downloader/downloader.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go
index a97cce1ef..18f8d2ba8 100644
--- a/eth/downloader/downloader.go
+++ b/eth/downloader/downloader.go
@@ -130,9 +130,12 @@ func (d *Downloader) Synchronise(id string, hash common.Hash) error {
defer atomic.StoreInt32(&d.synchronising, 0)
// Abort if the queue still contains some leftover data
- if _, cached := d.queue.Size(); cached > 0 {
+ if _, cached := d.queue.Size(); cached > 0 && d.queue.GetHeadBlock() != nil {
return errPendingQueue
}
+ // Reset the queue to clean any internal leftover state
+ d.queue.Reset()
+
// Retrieve the origin peer and initiate the downloading process
p := d.peers[id]
if p == nil {