Skip to content

Commit 16d0318

Browse files
jwasingerholiman
authored andcommitted
fix
1 parent 97b051f commit 16d0318

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

cmd/geth/chaincmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ It expects the genesis file as argument.`,
6262
Usage: "Dumps genesis block JSON configuration to stdout",
6363
ArgsUsage: "",
6464
Flags: append([]cli.Flag{utils.DataDirFlag}, utils.NetworkFlags...),
65-
Category: "BLOCKCHAIN COMMANDS",
6665
Description: `
6766
The dumpgenesis command prints the genesis configuration of the network preset
6867
if one is set. Otherwise it prints the genesis from the datadir.`,

cmd/utils/flags.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,7 @@ var (
988988
KilnFlag,
989989
}
990990
// NetworkFlags is the flag group of all built-in supported networks.
991-
NetworkFlags = append([]cli.Flag{
992-
MainnetFlag,
993-
}, TestnetFlags...)
991+
NetworkFlags = append([]cli.Flag{MainnetFlag}, TestnetFlags...)
994992

995993
// DatabasePathFlags is the flag group of all database path flags.
996994
DatabasePathFlags = []cli.Flag{
@@ -2141,14 +2139,12 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node, readonly bool) ethdb.
21412139
}
21422140

21432141
func IsNetworkPreset(ctx *cli.Context) bool {
2144-
for _, flag := range TestnetFlags {
2145-
if ctx.Bool(flag.String()) {
2142+
for _, flag := range NetworkFlags {
2143+
bFlag, _ := flag.(*cli.BoolFlag)
2144+
if ctx.IsSet(bFlag.Name) {
21462145
return true
21472146
}
21482147
}
2149-
if ctx.Bool(MainnetFlag.Name) {
2150-
return true
2151-
}
21522148
return false
21532149
}
21542150

0 commit comments

Comments
 (0)