diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 82ea79181ff3..c1b04754656f 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -61,7 +61,6 @@ It expects the genesis file as argument.`, Usage: "Dumps genesis block JSON configuration to stdout", ArgsUsage: "", Flags: append([]cli.Flag{utils.DataDirFlag}, utils.NetworkFlags...), - Category: "BLOCKCHAIN COMMANDS", Description: ` The dumpgenesis command prints the genesis configuration of the network preset if one is set. Otherwise it prints the genesis from the datadir.`, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index b7f53067dee4..61b8289c9fe8 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -982,9 +982,7 @@ var ( KilnFlag, } // NetworkFlags is the flag group of all built-in supported networks. - NetworkFlags = append([]cli.Flag{ - MainnetFlag, - }, TestnetFlags...) + NetworkFlags = append([]cli.Flag{MainnetFlag}, TestnetFlags...) // DatabasePathFlags is the flag group of all database path flags. DatabasePathFlags = []cli.Flag{ @@ -2135,14 +2133,12 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb. } func IsNetworkPreset(ctx *cli.Context) bool { - for _, flag := range TestnetFlags { - if ctx.Bool(flag.String()) { + for _, flag := range NetworkFlags { + bFlag, _ := flag.(*cli.BoolFlag) + if ctx.IsSet(bFlag.Name) { return true } } - if ctx.Bool(MainnetFlag.Name) { - return true - } return false }