@@ -654,6 +654,10 @@ func MakeNode(ctx *cli.Context, name, gitCommit string) *node.Node {
654654 vsn += "-" + gitCommit [:8 ]
655655 }
656656
657+ // if we're running a light client or server, force enable the v5 peer discovery unless it is explicitly disabled with --nodiscover
658+ // note that explicitly specifying --v5disc overrides --nodiscover, in which case the later only disables v4 discovery
659+ forceV5Discovery := (ctx .GlobalBool (LightModeFlag .Name ) || ctx .GlobalInt (LightServFlag .Name ) > 0 ) && ! ctx .GlobalBool (NoDiscoverFlag .Name )
660+
657661 config := & node.Config {
658662 DataDir : MakeDataDir (ctx ),
659663 KeyStoreDir : ctx .GlobalString (KeyStoreDirFlag .Name ),
@@ -662,8 +666,8 @@ func MakeNode(ctx *cli.Context, name, gitCommit string) *node.Node {
662666 Name : name ,
663667 Version : vsn ,
664668 UserIdent : makeNodeUserIdent (ctx ),
665- NoDiscovery : ctx .GlobalBool (NoDiscoverFlag .Name ) || ctx .GlobalBool (LightModeFlag .Name ),
666- DiscoveryV5 : ctx .GlobalBool (DiscoveryV5Flag .Name ) || ctx . GlobalBool ( LightModeFlag . Name ) || ctx . GlobalInt ( LightServFlag . Name ) > 0 ,
669+ NoDiscovery : ctx .GlobalBool (NoDiscoverFlag .Name ) || ctx .GlobalBool (LightModeFlag .Name ), // always disable v4 discovery in light client mode
670+ DiscoveryV5 : ctx .GlobalBool (DiscoveryV5Flag .Name ) || forceV5Discovery ,
667671 DiscoveryV5Addr : MakeDiscoveryV5Address (ctx ),
668672 BootstrapNodes : MakeBootstrapNodes (ctx ),
669673 BootstrapNodesV5 : MakeBootstrapNodesV5 (ctx ),
0 commit comments