diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 41582d1fde..376817356a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1050,8 +1050,10 @@ func SplitAndTrim(input string) (ret []string) { // setHTTP creates the HTTP RPC listener interface string from the set // command line flags, returning empty if the HTTP endpoint is disabled. func setHTTP(ctx *cli.Context, cfg *node.Config) { - if ctx.GlobalBool(HTTPEnabledFlag.Name) && cfg.HTTPHost == "" { - cfg.HTTPHost = "127.0.0.1" + if ctx.GlobalBool(HTTPEnabledFlag.Name) { + if cfg.HTTPHost == "" { + cfg.HTTPHost = "127.0.0.1" + } if ctx.GlobalIsSet(HTTPListenAddrFlag.Name) { cfg.HTTPHost = ctx.GlobalString(HTTPListenAddrFlag.Name) }