aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-20 08:12:14 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-01-20 08:12:14 +0800
commitebc3d232f4b6c197d5dc5da2e1868d56b2096f1a (patch)
tree290586cf2e1f98a01cefcdbee128d226f2764f65 /eth
parentf087c66f9599b0f4650ae643d3342b10a6b56c5b (diff)
downloadgo-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.gz
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.bz2
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.lz
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.xz
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.zst
go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.zip
eth/downloader: fix mutex regression causing panics on fail (#3591)
Diffstat (limited to 'eth')
-rw-r--r--eth/downloader/queue.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go
index dd9590b28..3318879e2 100644
--- a/eth/downloader/queue.go
+++ b/eth/downloader/queue.go
@@ -1129,12 +1129,13 @@ func (q *queue) deliverNodeData(results []trie.SyncResult, callback func(int, bo
if err != nil {
q.stateSchedLock.Unlock()
callback(i, progressed, err)
+ return
}
if err = batch.Write(); err != nil {
q.stateSchedLock.Unlock()
callback(i, progressed, err)
+ return // TODO(karalabe): If a DB write fails (disk full), we ought to cancel the sync
}
-
// Item processing succeeded, release the lock (temporarily)
progressed = progressed || prog
q.stateSchedLock.Unlock()