From df83610a307095b45bea2f5887acdacf9312a76f Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 19 Jan 2026 16:35:55 +0800 Subject: [PATCH] cmd: fix flag variable name (#1958) --- cmd/XDC/main.go | 8 ++++---- cmd/utils/flags.go | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/XDC/main.go b/cmd/XDC/main.go index 80356f1028..c60f3f6fad 100644 --- a/cmd/XDC/main.go +++ b/cmd/XDC/main.go @@ -161,10 +161,10 @@ var ( utils.WSPathPrefixFlag, utils.IPCDisabledFlag, utils.IPCPathFlag, - utils.RPCGlobalTxFeeCap, - utils.AllowUnprotectedTxs, - utils.BatchRequestLimit, - utils.BatchResponseMaxSize, + utils.RPCGlobalTxFeeCapFlag, + utils.AllowUnprotectedTxsFlag, + utils.BatchRequestLimitFlag, + utils.BatchResponseMaxSizeFlag, } metricsFlags = []cli.Flag{ diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index ac4ef45ada..e2be0e1f3b 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -400,7 +400,7 @@ var ( Value: ethconfig.Defaults.RPCEVMTimeout, Category: flags.APICategory, } - RPCGlobalTxFeeCap = &cli.Float64Flag{ + RPCGlobalTxFeeCapFlag = &cli.Float64Flag{ Name: "rpc-txfeecap", Aliases: []string{"rpc.txfeecap"}, Usage: "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)", @@ -580,18 +580,18 @@ var ( Usage: "Comma separated list of JavaScript files to preload into the console", Category: flags.APICategory, } - AllowUnprotectedTxs = &cli.BoolFlag{ + AllowUnprotectedTxsFlag = &cli.BoolFlag{ Name: "rpc-allow-unprotected-txs", Usage: "Allow for unprotected (non EIP155 signed) transactions to be submitted via RPC", Category: flags.APICategory, } - BatchRequestLimit = &cli.IntFlag{ + BatchRequestLimitFlag = &cli.IntFlag{ Name: "rpc-batch-request-limit", Usage: "Maximum number of requests in a batch", Value: node.DefaultConfig.BatchRequestLimit, Category: flags.APICategory, } - BatchResponseMaxSize = &cli.IntFlag{ + BatchResponseMaxSizeFlag = &cli.IntFlag{ Name: "rpc-batch-response-max-size", Usage: "Maximum number of bytes returned from a batched call", Value: node.DefaultConfig.BatchResponseMaxSize, @@ -1120,15 +1120,15 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) { cfg.HTTPTimeouts.IdleTimeout = ctx.Duration(HTTPIdleTimeoutFlag.Name) } - if ctx.IsSet(AllowUnprotectedTxs.Name) { - cfg.AllowUnprotectedTxs = ctx.Bool(AllowUnprotectedTxs.Name) + if ctx.IsSet(AllowUnprotectedTxsFlag.Name) { + cfg.AllowUnprotectedTxs = ctx.Bool(AllowUnprotectedTxsFlag.Name) } - if ctx.IsSet(BatchRequestLimit.Name) { - cfg.BatchRequestLimit = ctx.Int(BatchRequestLimit.Name) + if ctx.IsSet(BatchRequestLimitFlag.Name) { + cfg.BatchRequestLimit = ctx.Int(BatchRequestLimitFlag.Name) } - if ctx.IsSet(BatchResponseMaxSize.Name) { - cfg.BatchResponseMaxSize = ctx.Int(BatchResponseMaxSize.Name) + if ctx.IsSet(BatchResponseMaxSizeFlag.Name) { + cfg.BatchResponseMaxSize = ctx.Int(BatchResponseMaxSizeFlag.Name) } } @@ -1510,8 +1510,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if ctx.IsSet(RPCGlobalGasCapFlag.Name) { cfg.RPCGasCap = ctx.Uint64(RPCGlobalGasCapFlag.Name) } - if ctx.IsSet(RPCGlobalTxFeeCap.Name) { - cfg.RPCTxFeeCap = ctx.Float64(RPCGlobalTxFeeCap.Name) + if ctx.IsSet(RPCGlobalTxFeeCapFlag.Name) { + cfg.RPCTxFeeCap = ctx.Float64(RPCGlobalTxFeeCapFlag.Name) } if ctx.IsSet(RPCGlobalGasCapFlag.Name) { cfg.RPCGasCap = ctx.Uint64(RPCGlobalGasCapFlag.Name)