Skip to content

Commit

Permalink
fix bug about get the trace of opcode (ethereum#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Mar 31, 2022
1 parent 9f1d855 commit fccb5bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/vm/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ func (l *StructLogger) CaptureState(pc uint64, op OpCode, gas, cost uint64, scop
copy(rdata, rData)
}
execFuncList, ok := OpcodeExecs[op]
if !ok {
return
}
// execute trace func list.
for _, exec := range execFuncList {
if err = exec(l, scope, extraData); err != nil {
log.Error("Failed to trace data", "opcode", op.String(), "err", err)
if ok {
// execute trace func list.
for _, exec := range execFuncList {
if err = exec(l, scope, extraData); err != nil {
log.Error("Failed to trace data", "opcode", op.String(), "err", err)
}
}
}

// create a new snapshot of the EVM.
structLog := StructLog{pc, op, gas, cost, mem, memory.Len(), stck, rdata, storage, depth, l.env.StateDB.GetRefund(), extraData, err}
l.logs = append(l.logs, structLog)
Expand Down

0 comments on commit fccb5bf

Please sign in to comment.