mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/utils: check for empty string when parsing enode
This commit is contained in:
parent
6219b4541e
commit
f0a25e9d5b
1 changed files with 8 additions and 5 deletions
|
|
@ -779,6 +779,7 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
|
|||
node, err := enode.ParseV4(url)
|
||||
if err != nil {
|
||||
log.Crit("Bootstrap URL invalid", "enode", url, "err", err)
|
||||
continue
|
||||
}
|
||||
cfg.BootstrapNodes = append(cfg.BootstrapNodes, node)
|
||||
}
|
||||
|
|
@ -806,6 +807,7 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
|
|||
|
||||
cfg.BootstrapNodesV5 = make([]*discv5.Node, 0, len(urls))
|
||||
for _, url := range urls {
|
||||
if url != "" {
|
||||
node, err := discv5.ParseNode(url)
|
||||
if err != nil {
|
||||
log.Error("Bootstrap URL invalid", "enode", url, "err", err)
|
||||
|
|
@ -813,6 +815,7 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
|
|||
}
|
||||
cfg.BootstrapNodesV5 = append(cfg.BootstrapNodesV5, node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// setListenAddress creates a TCP listening address string from set command
|
||||
|
|
|
|||
Loading…
Reference in a new issue