From e9313c70996dd034f56281175a61025187c40c78 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 19 Jan 2017 13:37:21 +0100 Subject: [PATCH] eth/downloader: pass failed index to DeliverNodeData callback --- eth/downloader/queue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 6a49f561fd..e0435f43d1 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -1093,7 +1093,7 @@ func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(int, boo // scheduler treats everything as written after Process has returned, but it's // unlikely to be an issue in practice. batch := q.stateDatabase.NewBatch() - progressed, _, processErr := q.stateScheduler.Process(process, batch) + progressed, nproc, procerr := q.stateScheduler.Process(process, batch) q.stateWriters += 1 go func() { defer func() { @@ -1104,9 +1104,9 @@ func (q *queue) DeliverNodeData(id string, data [][]byte, callback func(int, boo // waiting for completion of the pivot block's state download. q.active.Signal() }() - if processErr != nil { + if procerr != nil { // Return processing errors through the callback so the sync gets canceled. - callback(len(process), progressed, processErr) + callback(nproc, progressed, procerr) return } err := batch.Write()