cmd/swarm: fail on SWARM_ENV_MAX_STREAM_PEER_SERVERS parsing error

This commit is contained in:
Janos Guljas 2018-09-27 10:08:57 +02:00
parent a5e6bf7eef
commit 86f68cf04f
1 changed files with 4 additions and 2 deletions

View File

@ -313,9 +313,11 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) {
} }
if max := os.Getenv(SWARM_ENV_MAX_STREAM_PEER_SERVERS); max != "" { if max := os.Getenv(SWARM_ENV_MAX_STREAM_PEER_SERVERS); max != "" {
if m, err := strconv.Atoi(max); err == nil { m, err := strconv.Atoi(max)
currentConfig.MaxStreamPeerServers = m if err != nil {
utils.Fatalf("invalid environment variable %s: %v", SWARM_ENV_MAX_STREAM_PEER_SERVERS, err)
} }
currentConfig.MaxStreamPeerServers = m
} }
if lne := os.Getenv(SWARM_ENV_LIGHT_NODE_ENABLE); lne != "" { if lne := os.Getenv(SWARM_ENV_LIGHT_NODE_ENABLE); lne != "" {