Przeglądaj źródła

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

Martin Holst Swende 5 lat temu
rodzic
commit
7451fc637d
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      internal/ethapi/api.go

+ 4 - 1
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)
 	}