Skip to content

Commit b9b9779

Browse files
committed
cmd,node: fix overwrite
1 parent cf93077 commit b9b9779

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmd/utils/flags.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

node/defaults.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ var DefaultConfig = Config{
6969
BatchResponseMaxSize: 25 * 1000 * 1000,
7070
GraphQLVirtualHosts: []string{"localhost"},
7171
P2P: p2p.Config{
72-
ListenAddr: ":30303",
73-
MaxPeers: 50,
74-
NAT: nat.Any(),
72+
ListenAddr: ":30303",
73+
MaxPeers: 50,
74+
NAT: nat.Any(),
75+
DiscoveryV4: true,
76+
DiscoveryV5: true,
7577
},
7678
DBEngine: "", // Use whatever exists, will default to Pebble if non-existent and supported
7779
}

0 commit comments

Comments
 (0)