From 6474da0f7abd4c9e3c520907385e3cb70ac54edc Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Mon, 19 Mar 2018 13:38:54 +0800 Subject: [PATCH] cmd/puppeth: add constraints to network name --- cmd/puppeth/puppeth.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index 26382dac13..beb52771ce 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -20,8 +20,10 @@ package main import ( "math/rand" "os" + "strings" "time" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) @@ -47,6 +49,10 @@ func main() { log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(c.Int("loglevel")), log.StreamHandler(os.Stdout, log.TerminalFormat(true)))) rand.Seed(time.Now().UnixNano()) + network := c.String("network") + if strings.Contains(network, " ") || strings.Contains(network, "-") { + utils.Fatalf("No spaces or hyphens allowed in network name") + } // Start the wizard and relinquish control makeWizard(c.String("network")).run() return nil