Skip to content

Commit 25fc5f0

Browse files
committed
Avoid overflow when adding additional gas
1 parent 658e67a commit 25fc5f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/ethapi/api.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,9 @@ func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *s
721721
if err != nil {
722722
return nil, err
723723
}
724-
gp.AddGas(postingGas)
724+
if gp.Gas() < gomath.MaxUint64-postingGas {
725+
gp.AddGas(postingGas)
726+
}
725727
}
726728
if msg.GasLimit > gp.Gas() {
727729
gp.SetGas(msg.GasLimit)

0 commit comments

Comments
 (0)