From 36f5e2a6fc1ffc80d09982f4d25169a750e783c8 Mon Sep 17 00:00:00 2001 From: zelig Date: Mon, 28 Nov 2016 09:00:32 +0100 Subject: [PATCH] cmd/bzzd: fix two bugs crashing bzzd if bootnodes flag given --- cmd/bzzd/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/bzzd/main.go b/cmd/bzzd/main.go index b8b2a6e23a..95cf860579 100644 --- a/cmd/bzzd/main.go +++ b/cmd/bzzd/main.go @@ -23,6 +23,7 @@ import ( "os" "runtime" "strconv" + "strings" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/cmd/utils" @@ -140,7 +141,8 @@ func bzzd(ctx *cli.Context) error { // Add bootnodes as initial peers. if ctx.GlobalIsSet(utils.BootnodesFlag.Name) { - injectBootnodes(stack.Server(), ctx.GlobalStringSlice(utils.BootnodesFlag.Name)) + bootnodes := strings.Split(ctx.GlobalString(utils.BootnodesFlag.Name), ",") + injectBootnodes(stack.Server(), bootnodes) } else { injectBootnodes(stack.Server(), defaultBootnodes) } @@ -243,6 +245,7 @@ func injectBootnodes(srv *p2p.Server, nodes []string) { n, err := discover.ParseNode(url) if err != nil { glog.Errorf("invalid bootnode %q", err) + continue } srv.AddPeer(n) }