Skip to content

Commit

Permalink
Unique bootnode urls
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy authored and gameofpointers committed Sep 28, 2023
1 parent 1e74a3c commit 4c9c5a8
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 27 deletions.
21 changes: 4 additions & 17 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,24 +752,11 @@ func setNodeUserIdent(ctx *cli.Context, cfg *node.Config) {
}
}

// setBootstrapNodes creates a list of bootstrap nodes from the command line
// flags, reverting to pre-configured ones if none have been specified.
// setBootstrapNodes creates a list of bootstrap nodes from the pre-configured
// ones if none have been specified.
func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls := params.ColosseumBootnodes
switch {
case ctx.GlobalIsSet(BootnodesFlag.Name):
urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
case ctx.GlobalBool(GardenFlag.Name):
urls = params.GardenBootnodes
case ctx.GlobalBool(OrchardFlag.Name):
urls = params.OrchardBootnodes
case ctx.GlobalBool(LighthouseFlag.Name):
urls = params.LighthouseBootnodes
case ctx.GlobalBool(LocalFlag.Name):
urls = []string{}
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
urls := params.ColosseumBootnodes[common.NodeLocation.Name()]
//TODO: fix bootnode parsing for other networks

cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls))
for _, url := range urls {
Expand Down
Loading

0 comments on commit 4c9c5a8

Please sign in to comment.