diff --git a/eth/tracers/native/zero.go b/eth/tracers/native/zero.go index dc357f7c090..a400024b501 100644 --- a/eth/tracers/native/zero.go +++ b/eth/tracers/native/zero.go @@ -122,7 +122,7 @@ func (t *zeroTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, sco slot := libcommon.Hash(stackData[stackLen-1].Bytes32()) // If the SSTORE is out of gas and the slot is in live state, we will add the slot to account read - if err == vm.ErrOutOfGas { + if err != nil { if t.env.IntraBlockState().HasLiveState(caller, &slot) { t.addAccountToTrace(caller) t.addSLOADToAccount(caller, slot) @@ -134,7 +134,7 @@ func (t *zeroTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, sco case stackLen >= 1 && (op == vm.EXTCODECOPY || op == vm.EXTCODEHASH || op == vm.EXTCODESIZE || op == vm.BALANCE || op == vm.SELFDESTRUCT): addr := libcommon.Address(stackData[stackLen-1].Bytes20()) - if err == vm.ErrOutOfGas && op == vm.SELFDESTRUCT { + if err != nil && op == vm.SELFDESTRUCT { if t.env.IntraBlockState().HasLiveAccount(addr) { t.addAccountToTrace(addr) } @@ -146,7 +146,7 @@ func (t *zeroTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, sco addr := libcommon.Address(stackData[stackLen-2].Bytes20()) // If the call is out of gas, we will add account but not the opcode - if err == vm.ErrOutOfGas && op == vm.CALL { + if err != nil && op == vm.CALL { if t.env.IntraBlockState().HasLiveAccount(addr) { t.addAccountToTrace(addr) }