p2p: pass maxConns for MaxPeers during node setup (#8684)

* pass maxConns for MaxPeers
* add upgrade connections to max connections for max peers
* change the formula to calculate max peers
This commit is contained in:
Evan Forbes
2022-06-03 09:22:38 -05:00
committed by GitHub
parent db168ca558
commit 30929cf190

View File

@@ -223,11 +223,13 @@ func createPeerManager(
maxConns = 64
}
maxUpgradeConns := uint16(4)
options := p2p.PeerManagerOptions{
SelfAddress: selfAddr,
MaxConnected: maxConns,
MaxConnectedUpgrade: 4,
MaxPeers: 1000,
MaxConnectedUpgrade: maxUpgradeConns,
MaxPeers: maxUpgradeConns + 2*maxConns,
MinRetryTime: 250 * time.Millisecond,
MaxRetryTime: 30 * time.Minute,
MaxRetryTimePersistent: 5 * time.Minute,