소스 검색

eth/downloader: fix mutex regression causing panics on fail (#3591)

Péter Szilágyi 8 년 전
부모
커밋
ebc3d232f4
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      eth/downloader/queue.go

+ 2 - 1
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()