internal/ethapi: default gas to maxgascap, not max int64 (#21284)

This commit is contained in:
Martin Holst Swende 2020-07-02 09:43:42 +02:00 committed by GitHub
parent 12867d152c
commit 7451fc637d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}