mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
cmd,node: fix overwrite
This commit is contained in:
parent
cf93077fab
commit
d15d1ee507
2 changed files with 13 additions and 7 deletions
|
|
@ -859,14 +859,14 @@ var (
|
||||||
Aliases: []string{"discv4"},
|
Aliases: []string{"discv4"},
|
||||||
Usage: "Enables the V4 discovery mechanism",
|
Usage: "Enables the V4 discovery mechanism",
|
||||||
Category: flags.NetworkingCategory,
|
Category: flags.NetworkingCategory,
|
||||||
Value: true,
|
Value: node.DefaultConfig.P2P.DiscoveryV4,
|
||||||
}
|
}
|
||||||
DiscoveryV5Flag = &cli.BoolFlag{
|
DiscoveryV5Flag = &cli.BoolFlag{
|
||||||
Name: "discovery.v5",
|
Name: "discovery.v5",
|
||||||
Aliases: []string{"discv5"},
|
Aliases: []string{"discv5"},
|
||||||
Usage: "Enables the V5 discovery mechanism",
|
Usage: "Enables the V5 discovery mechanism",
|
||||||
Category: flags.NetworkingCategory,
|
Category: flags.NetworkingCategory,
|
||||||
Value: true,
|
Value: node.DefaultConfig.P2P.DiscoveryV5,
|
||||||
}
|
}
|
||||||
NetrestrictFlag = &cli.StringFlag{
|
NetrestrictFlag = &cli.StringFlag{
|
||||||
Name: "netrestrict",
|
Name: "netrestrict",
|
||||||
|
|
@ -1368,8 +1368,12 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
||||||
|
|
||||||
flags.CheckExclusive(ctx, DiscoveryV4Flag, NoDiscoverFlag)
|
flags.CheckExclusive(ctx, DiscoveryV4Flag, NoDiscoverFlag)
|
||||||
flags.CheckExclusive(ctx, DiscoveryV5Flag, NoDiscoverFlag)
|
flags.CheckExclusive(ctx, DiscoveryV5Flag, NoDiscoverFlag)
|
||||||
cfg.DiscoveryV4 = ctx.Bool(DiscoveryV4Flag.Name)
|
if ctx.IsSet(DiscoveryV4Flag.Name) {
|
||||||
cfg.DiscoveryV5 = ctx.Bool(DiscoveryV5Flag.Name)
|
cfg.DiscoveryV4 = ctx.Bool(DiscoveryV4Flag.Name)
|
||||||
|
}
|
||||||
|
if ctx.IsSet(DiscoveryV5Flag.Name) {
|
||||||
|
cfg.DiscoveryV5 = ctx.Bool(DiscoveryV5Flag.Name)
|
||||||
|
}
|
||||||
|
|
||||||
if netrestrict := ctx.String(NetrestrictFlag.Name); netrestrict != "" {
|
if netrestrict := ctx.String(NetrestrictFlag.Name); netrestrict != "" {
|
||||||
list, err := netutil.ParseNetlist(netrestrict)
|
list, err := netutil.ParseNetlist(netrestrict)
|
||||||
|
|
|
||||||
|
|
@ -69,9 +69,11 @@ var DefaultConfig = Config{
|
||||||
BatchResponseMaxSize: 25 * 1000 * 1000,
|
BatchResponseMaxSize: 25 * 1000 * 1000,
|
||||||
GraphQLVirtualHosts: []string{"localhost"},
|
GraphQLVirtualHosts: []string{"localhost"},
|
||||||
P2P: p2p.Config{
|
P2P: p2p.Config{
|
||||||
ListenAddr: ":30303",
|
ListenAddr: ":30303",
|
||||||
MaxPeers: 50,
|
MaxPeers: 50,
|
||||||
NAT: nat.Any(),
|
NAT: nat.Any(),
|
||||||
|
DiscoveryV4: true,
|
||||||
|
DiscoveryV5: true,
|
||||||
},
|
},
|
||||||
DBEngine: "", // Use whatever exists, will default to Pebble if non-existent and supported
|
DBEngine: "", // Use whatever exists, will default to Pebble if non-existent and supported
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue