mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 01:40:07 +01:00
server: Cap max outbound in connmgr cfg at max peers
This commit is contained in:
parent
6951d8e235
commit
d1c39edee8
@ -2440,9 +2440,13 @@ func newServer(listenAddrs []string, db database.DB, chainParams *chaincfg.Param
|
||||
}
|
||||
|
||||
// Create a connection manager.
|
||||
maxOutbound := defaultMaxOutbound
|
||||
if cfg.MaxPeers < maxOutbound {
|
||||
maxOutbound = cfg.MaxPeers
|
||||
}
|
||||
cmgr, err := connmgr.New(&connmgr.Config{
|
||||
RetryDuration: connectionRetryInterval,
|
||||
MaxOutbound: defaultMaxOutbound,
|
||||
MaxOutbound: uint32(maxOutbound),
|
||||
Dial: btcdDial,
|
||||
OnConnection: s.outboundPeerConnected,
|
||||
GetNewAddress: newAddressFunc,
|
||||
|
Loading…
Reference in New Issue
Block a user