From 4d9c90ed4ad5837e4a86e122361201b55e5cb234 Mon Sep 17 00:00:00 2001 From: zgfzgf <1901989065@qq.com> Date: Tue, 3 Nov 2020 15:46:35 +0800 Subject: [PATCH] modify runtime gasUsed printf --- chain/vm/runtime.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chain/vm/runtime.go b/chain/vm/runtime.go index 6e36e8e87..5dc175726 100644 --- a/chain/vm/runtime.go +++ b/chain/vm/runtime.go @@ -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