From ebc3d232f4b6c197d5dc5da2e1868d56b2096f1a Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Fri, 20 Jan 2017 02:12:14 +0200 Subject: eth/downloader: fix mutex regression causing panics on fail (#3591) --- eth/downloader/queue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'eth/downloader/queue.go') 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() -- cgit