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 atif-konasl committed Oct 15, 2021
1 parent 3811ede commit 21afcd2
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 @@ -87,8 +87,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 {
l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, err.Error()})
errMsg = err.Error()
}
l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, ""})
l.encoder.Encode(endLog{common.Bytes2Hex(output), math.HexOrDecimal64(gasUsed), t, errMsg})
}

0 comments on commit 21afcd2

Please sign in to comment.