core/vm: fix refund gas logic

This commit is contained in:
Marius van der Wijden 2026-03-10 17:44:00 +01:00
parent 829dc9424f
commit 7f045f6c4c

View file

@ -145,7 +145,7 @@ func (c *Contract) RefundGas(err error, gas GasCosts, logger *tracing.Hooks, rea
gas.StateGas += gas.StateGasCharged
gas.StateGasCharged = 0
}
if gas.Max() == 0 {
if gas.RegularGas == 0 && gas.StateGas == 0 && gas.StateGasCharged == 0 {
return
}
if logger != nil && logger.OnGasChange != nil && reason != tracing.GasChangeIgnored {