aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorSjonHortensius <SjonHortensius@users.noreply.github.com>2019-09-03 16:43:35 +0800
committerFelix Lange <fjl@twurst.com>2019-09-03 16:43:35 +0800
commit1611815b8dc7e5168823a0bb5785a65f59579ec9 (patch)
tree0755868d1e3985270b5b4cc8798e64171f0dfd93 /cmd/utils/flags.go
parentb8a94571397c1afd5579f1e319aff05a676c917d (diff)
downloadgo-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar.gz
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar.bz2
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar.lz
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar.xz
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.tar.zst
go-tangerine-1611815b8dc7e5168823a0bb5785a65f59579ec9.zip
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
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index d553b662c..773207339 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -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) {