@@ -859,14 +859,14 @@ var (
859859 Aliases : []string {"discv4" },
860860 Usage : "Enables the V4 discovery mechanism" ,
861861 Category : flags .NetworkingCategory ,
862- Value : true ,
862+ Value : node . DefaultConfig . P2P . DiscoveryV4 ,
863863 }
864864 DiscoveryV5Flag = & cli.BoolFlag {
865865 Name : "discovery.v5" ,
866866 Aliases : []string {"discv5" },
867867 Usage : "Enables the V5 discovery mechanism" ,
868868 Category : flags .NetworkingCategory ,
869- Value : true ,
869+ Value : node . DefaultConfig . P2P . DiscoveryV5 ,
870870 }
871871 NetrestrictFlag = & cli.StringFlag {
872872 Name : "netrestrict" ,
@@ -1368,8 +1368,12 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
13681368
13691369 flags .CheckExclusive (ctx , DiscoveryV4Flag , NoDiscoverFlag )
13701370 flags .CheckExclusive (ctx , DiscoveryV5Flag , NoDiscoverFlag )
1371- cfg .DiscoveryV4 = ctx .Bool (DiscoveryV4Flag .Name )
1372- cfg .DiscoveryV5 = ctx .Bool (DiscoveryV5Flag .Name )
1371+ if ctx .IsSet (DiscoveryV4Flag .Name ) {
1372+ cfg .DiscoveryV4 = ctx .Bool (DiscoveryV4Flag .Name )
1373+ }
1374+ if ctx .IsSet (DiscoveryV5Flag .Name ) {
1375+ cfg .DiscoveryV5 = ctx .Bool (DiscoveryV5Flag .Name )
1376+ }
13731377
13741378 if netrestrict := ctx .String (NetrestrictFlag .Name ); netrestrict != "" {
13751379 list , err := netutil .ParseNetlist (netrestrict )
0 commit comments