From d89d7ebdec27d8c8fed217767e2f17b09b5460a0 Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Tue, 5 Mar 2024 16:47:58 +0800 Subject: [PATCH] core: initialize `gasRemaining` with `=` instead of `+=` (#29149) initialize gasRemaining with = instead of += --- core/state_transition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state_transition.go b/core/state_transition.go index 9c4f76d1c5..bda2a995bf 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -263,7 +263,7 @@ func (st *StateTransition) buyGas() error { if err := st.gp.SubGas(st.msg.GasLimit); err != nil { return err } - st.gasRemaining += st.msg.GasLimit + st.gasRemaining = st.msg.GasLimit st.initialGas = st.msg.GasLimit mgvalU256, _ := uint256.FromBig(mgval)