diff --git a/miner/worker.go b/miner/worker.go index 4a9528c395..e700afeef3 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -299,8 +299,9 @@ func (w *worker) newWorkLoop(recommit time.Duration) { commit := func(noempty bool, s int32) { if interrupt != nil { atomic.StoreInt32(interrupt, s) + } else { + interrupt = new(int32) } - interrupt = new(int32) w.newWorkCh <- &newWorkReq{interrupt: interrupt, noempty: noempty, timestamp: timestamp} timer.Reset(recommit) atomic.StoreInt32(&w.newTxs, 0)