diff options
author | a e r t h <aerth@users.noreply.github.com> | 2018-07-26 18:57:20 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-26 18:57:20 +0800 |
commit | 021d6fbbbbdfe295dbb3619f8ec3fc8662c1e26a (patch) | |
tree | 67fc9abcf11c04fc5d45c14d8883aa0a928583a3 /cmd/geth/main.go | |
parent | feed8069a64ab4464aff589ecccf1bb3907faba4 (diff) | |
download | dexon-021d6fbbbbdfe295dbb3619f8ec3fc8662c1e26a.tar.gz dexon-021d6fbbbbdfe295dbb3619f8ec3fc8662c1e26a.tar.zst dexon-021d6fbbbbdfe295dbb3619f8ec3fc8662c1e26a.zip |
cmd: prevent accidental invalid commands (#17248)
* cmd: stop parsing bootnodes if one is invalid
* cmd/geth: require valid command as argument (or no arg)
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 1c618de35..77ef6afe2 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -251,6 +251,9 @@ func main() { // It creates a default node based on the command line arguments and runs it in // blocking mode, waiting for it to be shut down. func geth(ctx *cli.Context) error { + if args := ctx.Args(); len(args) > 0 { + return fmt.Errorf("invalid command: %q", args[0]) + } node := makeFullNode(ctx) startNode(ctx, node) node.Wait() |