mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-19 14:29:27 +00:00
cmd/utils: fix maxpeers vs lightpeers logic (#16125)
This commit is contained in:
parent
77da203547
commit
1488fdaf19
1 changed files with 3 additions and 0 deletions
|
|
@ -814,6 +814,9 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
||||||
|
|
||||||
if ctx.GlobalIsSet(MaxPeersFlag.Name) {
|
if ctx.GlobalIsSet(MaxPeersFlag.Name) {
|
||||||
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
|
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
|
||||||
|
if lightServer && !ctx.GlobalIsSet(LightPeersFlag.Name) {
|
||||||
|
cfg.MaxPeers += lightPeers
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if lightServer {
|
if lightServer {
|
||||||
cfg.MaxPeers += lightPeers
|
cfg.MaxPeers += lightPeers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue