Adding a lock around WriteBlockWithState while processing sealing result

This commit is contained in:
Jitendra Bhurat 2019-04-16 15:23:42 -04:00
parent 2d22fd0044
commit 9dbafd38c5
1 changed files with 2 additions and 0 deletions

View File

@ -605,7 +605,9 @@ func (w *worker) resultLoop() {
allReceipts := mergeReceipts(work.receipts, work.privateReceipts)
// Commit block and state to database.
w.mu.Lock()
stat, err := w.chain.WriteBlockWithState(block, allReceipts, work.state, nil)
w.mu.Unlock()
if err != nil {
log.Error("Failed writWriteBlockAndStating block to chain", "err", err)
continue