mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
eth/downloader: pass failed index to DeliverNodeData callback
This commit is contained in:
parent
22a48fe5e8
commit
e9313c7099
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
// scheduler treats everything as written after Process has returned, but it's
|
||||||
// unlikely to be an issue in practice.
|
// unlikely to be an issue in practice.
|
||||||
batch := q.stateDatabase.NewBatch()
|
batch := q.stateDatabase.NewBatch()
|
||||||
progressed, _, processErr := q.stateScheduler.Process(process, batch)
|
progressed, nproc, procerr := q.stateScheduler.Process(process, batch)
|
||||||
q.stateWriters += 1
|
q.stateWriters += 1
|
||||||
go func() {
|
go func() {
|
||||||
defer 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.
|
// waiting for completion of the pivot block's state download.
|
||||||
q.active.Signal()
|
q.active.Signal()
|
||||||
}()
|
}()
|
||||||
if processErr != nil {
|
if procerr != nil {
|
||||||
// Return processing errors through the callback so the sync gets canceled.
|
// Return processing errors through the callback so the sync gets canceled.
|
||||||
callback(len(process), progressed, processErr)
|
callback(nproc, progressed, procerr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err := batch.Write()
|
err := batch.Write()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue