fix bug about get the trace of opcode (#67)

This commit is contained in:
maskpp 2022-03-31 15:00:55 +08:00 committed by GitHub
parent 9f1d8552e4
commit fccb5bf6ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)