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-04-08 20:13:50 +02:00
parent b7a42b5243
commit 6049c9d697
10 changed files with 155 additions and 9 deletions
+5
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
}