mempool: reserve IDs in InitPeer instead of AddPeer

p2p: limit the number of incoming connections

to p2p.max_num_inbound_peers + len(p2p.unconditional_peer_ids)

update changelog and version

changelog: fix grammar

UnconditionalPeerIDs do not exist in v0.31
This commit is contained in:
Alessio Treglia
2020-03-27 15:08:53 +01:00
parent b7a42b5243
commit 6049c9d697
10 changed files with 155 additions and 9 deletions

View File

@@ -407,6 +407,11 @@ func createTransport(config *cfg.Config, nodeInfo p2p.NodeInfo, nodeKey *p2p.Nod
}
p2p.MultiplexTransportConnFilters(connFilters...)(transport)
// Limit the number of incoming connections.
max := config.P2P.MaxNumInboundPeers
p2p.MultiplexTransportMaxIncomingConnections(max)(transport)
return transport, peerFilters
}