mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Update flags.go
This commit is contained in:
parent
1a1fb9174d
commit
5c0b964fd3
1 changed files with 6 additions and 2 deletions
|
|
@ -1089,7 +1089,9 @@ func SplitAndTrim(input string) (ret []string) {
|
||||||
// command line flags, returning empty if the HTTP endpoint is disabled.
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
||||||
func setHTTP(ctx *cli.Context, cfg *node.Config) {
|
func setHTTP(ctx *cli.Context, cfg *node.Config) {
|
||||||
if ctx.Bool(HTTPEnabledFlag.Name) {
|
if ctx.Bool(HTTPEnabledFlag.Name) {
|
||||||
|
if cfg.HTTPHost == "" {
|
||||||
cfg.HTTPHost = "127.0.0.1"
|
cfg.HTTPHost = "127.0.0.1"
|
||||||
|
}
|
||||||
if ctx.IsSet(HTTPListenAddrFlag.Name) {
|
if ctx.IsSet(HTTPListenAddrFlag.Name) {
|
||||||
cfg.HTTPHost = ctx.String(HTTPListenAddrFlag.Name)
|
cfg.HTTPHost = ctx.String(HTTPListenAddrFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
@ -1154,7 +1156,9 @@ func setGraphQL(ctx *cli.Context, cfg *node.Config) {
|
||||||
// command line flags, returning empty if the HTTP endpoint is disabled.
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
||||||
func setWS(ctx *cli.Context, cfg *node.Config) {
|
func setWS(ctx *cli.Context, cfg *node.Config) {
|
||||||
if ctx.Bool(WSEnabledFlag.Name) {
|
if ctx.Bool(WSEnabledFlag.Name) {
|
||||||
|
if cfg.WSHost == "" {
|
||||||
cfg.WSHost = "127.0.0.1"
|
cfg.WSHost = "127.0.0.1"
|
||||||
|
}
|
||||||
if ctx.IsSet(WSListenAddrFlag.Name) {
|
if ctx.IsSet(WSListenAddrFlag.Name) {
|
||||||
cfg.WSHost = ctx.String(WSListenAddrFlag.Name)
|
cfg.WSHost = ctx.String(WSListenAddrFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue