good morning!!!!

Skip to content
Snippets Groups Projects
Commit 021d6fbb authored by a e r t h's avatar a e r t h Committed by Péter Szilágyi
Browse files

cmd: prevent accidental invalid commands (#17248)

* cmd: stop parsing bootnodes if one is invalid

* cmd/geth: require valid command as argument (or no arg)
parent feed8069
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
......@@ -644,8 +644,7 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
for _, url := range urls {
node, err := discover.ParseNode(url)
if err != nil {
log.Error("Bootstrap URL invalid", "enode", url, "err", err)
continue
log.Crit("Bootstrap URL invalid", "enode", url, "err", err)
}
cfg.BootstrapNodes = append(cfg.BootstrapNodes, node)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment