diff --git a/miner/worker.go b/miner/worker.go index 0e1dd83691..b3815ac2eb 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -955,6 +955,14 @@ func (w *worker) commitTransactions(env *environment, txs *transactionsByPriceAn mainloop: for { + // Check interruption signal and abort building if it's fired. + if interrupt != nil { + if signal := interrupt.Load(); signal != commitInterruptNone { + breakCause = "interrupt" + return signalToErr(signal) + } + } + if interruptCtx != nil { if EnableMVHashMap && w.IsRunning() { env.state.AddEmptyMVHashMap() @@ -970,13 +978,6 @@ mainloop: } } - // Check interruption signal and abort building if it's fired. - if interrupt != nil { - if signal := interrupt.Load(); signal != commitInterruptNone { - breakCause = "interrupt" - return signalToErr(signal) - } - } // If we don't have enough gas for any further transactions then we're done. if env.gasPool.Gas() < params.TxGas { breakCause = "Not enough gas for further transactions"