From 7451fc637d0b6f1e6c32381e80c6a2fff665b6bf Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 2 Jul 2020 09:43:42 +0200 Subject: [PATCH] internal/ethapi: default gas to maxgascap, not max int64 (#21284) --- internal/ethapi/api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 1e01c4167..162b38fbe 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -749,7 +749,10 @@ func (args *CallArgs) ToMessage(globalGasCap uint64) types.Message { } // Set default gas & gas price if none were set - gas := uint64(math.MaxUint64 / 2) + gas := globalGasCap + if gas == 0 { + gas = uint64(math.MaxUint64 / 2) + } if args.Gas != nil { gas = uint64(*args.Gas) }