Skip to content

Commit 6a07fcc

Browse files
authored
miner: fix commitWork not interrupted properly (#2919)
1 parent c266001 commit 6a07fcc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

miner/worker.go

+5
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,11 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
450450
if !w.isRunning() {
451451
continue
452452
}
453+
if interruptCh != nil {
454+
interruptCh <- commitInterruptNewHead
455+
close(interruptCh)
456+
interruptCh = nil
457+
}
453458
clearPending(head.Header.Number.Uint64())
454459
timestamp = time.Now().Unix()
455460
if p, ok := w.engine.(*parlia.Parlia); ok {

0 commit comments

Comments
 (0)