diff options
author | Janos Guljas <janos@resenje.org> | 2018-09-28 21:56:42 +0800 |
---|---|---|
committer | Janos Guljas <janos@resenje.org> | 2018-09-28 21:56:42 +0800 |
commit | bf37241eb5031aa081152f654f28a65496bc7586 (patch) | |
tree | 5051328b0061570e4f2865546b6031cac3b34dab | |
parent | c63985d194272867a718dc6dfc10f5393cf239f6 (diff) | |
download | go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar.gz go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar.bz2 go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar.lz go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar.xz go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.tar.zst go-tangerine-bf37241eb5031aa081152f654f28a65496bc7586.zip |
cmd/swarm: fix TestConfigFileOverrides
-rw-r--r-- | cmd/swarm/config.go | 8 | ||||
-rw-r--r-- | cmd/swarm/main.go | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 6d261d305..e623de8bb 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -179,7 +179,9 @@ func cmdLineOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Con if err != nil { utils.Fatalf("invalid cli flag %s: %v", SwarmNetworkIdFlag.Name, err) } - currentConfig.NetworkID = id + if id != 0 { + currentConfig.NetworkID = id + } } if ctx.GlobalIsSet(utils.DataDirFlag.Name) { @@ -272,7 +274,9 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) { if err != nil { utils.Fatalf("invalid environment variable %s: %v", SWARM_ENV_NETWORK_ID, err) } - currentConfig.NetworkID = id + if id != 0 { + currentConfig.NetworkID = id + } } if datadir := os.Getenv(GETH_ENV_DATADIR); datadir != "" { diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 197836699..4c9ce931e 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -95,7 +95,6 @@ var ( Name: "bzznetworkid", Usage: "Network identifier (integer, default 3=swarm testnet)", EnvVar: SWARM_ENV_NETWORK_ID, - Value: 3, } SwarmSwapEnabledFlag = cli.BoolFlag{ Name: "swap", |