Skip to content

Commit

Permalink
overwrite HTTPHost in config.toml via cli (bnb-chain#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu authored and unclezoro committed Sep 21, 2022
1 parent 3c7bccb commit 8375939
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8375939

Please sign in to comment.