Skip to content

Commit 7948b4a

Browse files
qdm12ARR4N
andauthored
Simplify check for used gas
Co-authored-by: Arran Schlosberg <[email protected]> Signed-off-by: Quentin McGaw <[email protected]>
1 parent fabf9d9 commit 7948b4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libevm/legacy/legacy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (c PrecompiledStatefulContract) Upgrade() vm.PrecompiledStatefulContract {
3838
if remainingGas > gas {
3939
return nil, fmt.Errorf("remaining gas %d exceeds supplied gas %d", remainingGas, gas)
4040
}
41-
if used := gas - remainingGas; used <= gas {
41+
if used := gas - remainingGas; used > 0 {
4242
env.UseGas(used)
4343
}
4444
return ret, err

0 commit comments

Comments
 (0)