From e6e566439685bcfc59d46db2992266cccd8867b9 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 6 Apr 2017 19:36:54 +0200 Subject: [PATCH] cmd/geth: hide genesis block in dumpconfig output --- cmd/geth/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 2eaef9dbab..d0446b1ad7 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -20,6 +20,7 @@ import ( "bufio" "encoding/hex" "errors" + "io" "os" cli "gopkg.in/urfave/cli.v1" @@ -137,10 +138,18 @@ func makeFullNode(ctx *cli.Context) *node.Node { // dumpConfig is the dumpconfig command. func dumpConfig(ctx *cli.Context) error { _, cfg := makeConfigNode(ctx) + comment := "" + + if cfg.Eth.Genesis != nil { + cfg.Eth.Genesis = nil + comment += "# Note: this config doesn't contain the genesis block.\n\n" + } + out, err := toml.Marshal(&cfg) if err != nil { return err } + io.WriteString(os.Stdout, comment) os.Stdout.Write(out) return nil }