mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 23:43:47 +00:00
cmd/geth: hide genesis block in dumpconfig output
This commit is contained in:
parent
f3fb2fc006
commit
e6e5664396
1 changed files with 9 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
cli "gopkg.in/urfave/cli.v1"
|
cli "gopkg.in/urfave/cli.v1"
|
||||||
|
|
@ -137,10 +138,18 @@ func makeFullNode(ctx *cli.Context) *node.Node {
|
||||||
// dumpConfig is the dumpconfig command.
|
// dumpConfig is the dumpconfig command.
|
||||||
func dumpConfig(ctx *cli.Context) error {
|
func dumpConfig(ctx *cli.Context) error {
|
||||||
_, cfg := makeConfigNode(ctx)
|
_, 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)
|
out, err := toml.Marshal(&cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
io.WriteString(os.Stdout, comment)
|
||||||
os.Stdout.Write(out)
|
os.Stdout.Write(out)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue