diff --git a/core/state_processor.go b/core/state_processor.go index 149dfee5050d..170337711148 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -140,7 +140,7 @@ func ApplyTransactionWithEVM(msg *Message, gp *GasPool, statedb *state.StateDB, hooks.OnTxStart(evm.GetVMContext(), tx, msg.From) } if hooks.OnTxEnd != nil { - defer hooks.OnTxEnd(receipt, err) + defer func() { hooks.OnTxEnd(receipt, err) }() } }