Skip to content

Commit

Permalink
Merge pull request #4704 from zgfzgf/fix-runtime-gas-print
Browse files Browse the repository at this point in the history
modify runtime gasUsed printf
  • Loading branch information
magik6k authored Nov 3, 2020
2 parents b7b6252 + 4d9c90e commit c215615
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chain/vm/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,10 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError

// overflow safe
if rt.gasUsed > rt.gasAvailable-toUse {
gasUsed := rt.gasUsed
rt.gasUsed = rt.gasAvailable
return aerrors.Newf(exitcode.SysErrOutOfGas, "not enough gas: used=%d, available=%d",
rt.gasUsed, rt.gasAvailable)
return aerrors.Newf(exitcode.SysErrOutOfGas, "not enough gas: used=%d, available=%d, use=%d",
gasUsed, rt.gasAvailable, toUse)
}
rt.gasUsed += toUse
return nil
Expand Down

0 comments on commit c215615

Please sign in to comment.