From 4ce96802121b8cf7b66543f2116b320aa5489389 Mon Sep 17 00:00:00 2001 From: Andre Patta Date: Wed, 29 Jun 2022 06:57:12 -0300 Subject: [PATCH] cmd/utils: fix applying bootstrap nodes from config file (#25174) --- cmd/utils/flags.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 376817356..5a9dd0697 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -296,12 +296,12 @@ var ( defaultVerifyMode = ethconfig.Defaults.TriesVerifyMode TriesVerifyModeFlag = TextMarshalerFlag{ Name: "tries-verify-mode", - Usage: `tries verify mode: - "local(default): a normal full node with complete state world(both MPT and snapshot), merkle state root will - be verified against the block header.", - "full: a fast node with only snapshot state world. Merkle state root is verified by the trustworthy remote verify node - by comparing the diffhash(an identify of difflayer generated by the block) and state root.", - "insecure: same as full mode, except that it can tolerate without verifying the diffhash when verify node does not have it.", + Usage: `tries verify mode: + "local(default): a normal full node with complete state world(both MPT and snapshot), merkle state root will + be verified against the block header.", + "full: a fast node with only snapshot state world. Merkle state root is verified by the trustworthy remote verify node + by comparing the diffhash(an identify of difflayer generated by the block) and state root.", + "insecure: same as full mode, except that it can tolerate without verifying the diffhash when verify node does not have it.", "none: no merkle state root verification at all, there is no need to setup or connect remote verify node at all, it is more light comparing to full and insecure mode, but get a very small chance that the state is not consistent with other peers."`, @@ -975,10 +975,11 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.RinkebyBootnodes case ctx.GlobalBool(GoerliFlag.Name): urls = params.GoerliBootnodes - 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)) for _, url := range urls { if url != "" {