diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-01-20 08:12:14 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-01-20 08:12:14 +0800 |
commit | ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a (patch) | |
tree | 290586cf2e1f98a01cefcdbee128d226f2764f65 /eth | |
parent | f087c66f9599b0f4650ae643d3342b10a6b56c5b (diff) | |
download | go-tangerine-ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a.tar.gz 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.go | 3 |
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() |