[NOD-498] Disable the option to choose mainnet and activeNet. (#525)

This commit is contained in:
Dan Aharoni 2019-12-08 18:33:04 +02:00 committed by Svarog
parent 369ec449a8
commit c94becf144
2 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,14 @@ func (networkFlags *NetworkFlags) ResolveNetwork(parser *flags.Parser) error {
parser.WriteHelp(os.Stderr)
return err
}
if numNets == 0 {
message := "Mainnet has not launched yet, use --testnet to run in testnet mode"
err := errors.Errorf(message)
fmt.Fprintln(os.Stderr, err)
return err
}
return nil
}

View File

@ -88,6 +88,10 @@ func setupGlobalConfig() error {
"can't be used together -- choose one of the four")
}
if numNets == 0 {
return errors.New("Mainnet has not launched yet, use --testnet to run in testnet mode")
}
// Validate database type.
if !validDbType(cfg.DbType) {
str := "The specified database type [%s] is invalid -- " +