cmd/utils: fix applying bootstrap nodes from config file (#25174)

This commit is contained in:
Andre Patta 2022-06-29 06:57:12 -03:00 committed by GitHub
parent 300f6121ad
commit 9ecf8a97a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1081,8 +1081,11 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.GoerliBootnodes urls = params.GoerliBootnodes
case ctx.Bool(KilnFlag.Name): case ctx.Bool(KilnFlag.Name):
urls = params.KilnBootnodes urls = params.KilnBootnodes
case cfg.BootstrapNodes != nil: }
return // already set, don't apply defaults.
// don't apply defaults if BootstrapNodes is already set
if cfg.BootstrapNodes != nil {
return
} }
cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls)) cfg.BootstrapNodes = make([]*enode.Node, 0, len(urls))