mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-04 17:15:55 +00:00
cmd/utils: reduce light.maxpeers default for clients to 1/10th (#19933)
Currently light.maxpeers is 100 - after this change it's 10 for non-servers. Fixes #19820
This commit is contained in:
parent
b8a9457139
commit
1611815b8d
1 changed files with 5 additions and 0 deletions
|
|
@ -1109,6 +1109,11 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
|||
if ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
|
||||
lightPeers = ctx.GlobalInt(LightMaxPeersFlag.Name)
|
||||
}
|
||||
if lightClient && !ctx.GlobalIsSet(LightLegacyPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
|
||||
// dynamic default - for clients we use 1/10th of the default for servers
|
||||
lightPeers /= 10
|
||||
}
|
||||
|
||||
if ctx.GlobalIsSet(MaxPeersFlag.Name) {
|
||||
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
|
||||
if lightServer && !ctx.GlobalIsSet(LightLegacyPeersFlag.Name) && !ctx.GlobalIsSet(LightMaxPeersFlag.Name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue