Skip to content

Commit

Permalink
core/vm: avoid duplicate log in json logger (ethereum#22825)
Browse files Browse the repository at this point in the history
  • Loading branch information
JekaMas authored and gzliudan committed Mar 1, 2024
1 parent 7c6908b commit 21bbe5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/vm/logger_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ func (l *JSONLogger) CaptureEnd(output []byte, gasUsed uint64, t time.Duration,
Time time.Duration `json:"time"`
Err string `json:"error,omitempty"`
}
var errMsg string
if err != nil {
return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, err.Error()})
errMsg = err.Error()
}
return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, ""})
return l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, errMsg})
}

0 comments on commit 21bbe5f

Please sign in to comment.