cmd/utils: fix maxpeers vs lightpeers logic

This commit is contained in:
Zsolt Felfoldi 2018-02-18 22:36:59 +01:00
parent 423c8bb1d8
commit 82bc795cd7

View file

@ -818,6 +818,9 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
if ctx.GlobalIsSet(MaxPeersFlag.Name) {
cfg.MaxPeers = ctx.GlobalInt(MaxPeersFlag.Name)
if lightServer && !ctx.GlobalIsSet(LightPeersFlag.Name) {
cfg.MaxPeers += lightPeers
}
} else {
if lightServer {
cfg.MaxPeers += lightPeers