diff options
Diffstat (limited to 'eth/downloader/queue.go')
-rw-r--r-- | eth/downloader/queue.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index bb8d892cd..17fbb1c7f 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -422,10 +422,12 @@ func (q *queue) ReserveNodeData(p *peer, count int) *fetchRequest { q.stateSchedLock.Lock() defer q.stateSchedLock.Unlock() - for _, hash := range q.stateScheduler.Missing(max) { - q.stateTaskPool[hash] = q.stateTaskIndex - q.stateTaskQueue.Push(hash, -float32(q.stateTaskIndex)) - q.stateTaskIndex++ + if q.stateScheduler != nil { + for _, hash := range q.stateScheduler.Missing(max) { + q.stateTaskPool[hash] = q.stateTaskIndex + q.stateTaskQueue.Push(hash, -float32(q.stateTaskIndex)) + q.stateTaskIndex++ + } } } return q.reserveHashes(p, count, q.stateTaskQueue, generator, q.statePendPool, count) |