Pause Kademlia if too many connections (#4828)

* Pause Kademlia if too many connections

* Fix test

* Update client/network/src/discovery.rs

Co-Authored-By: Toralf Wittner <tw@dtex.org>

* Change the limit

Co-authored-by: Toralf Wittner <tw@dtex.org>
This commit is contained in:
Pierre Krieger
2020-02-11 12:22:25 +01:00
committed by GitHub
parent ea69238d03
commit b0a749548d
3 changed files with 25 additions and 6 deletions
+3 -1
View File
@@ -65,6 +65,7 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Behaviour<B, S, H> {
known_addresses: Vec<(PeerId, Multiaddr)>,
enable_mdns: bool,
allow_private_ipv4: bool,
discovery_only_if_under_num: u64,
) -> Self {
Behaviour {
substrate,
@@ -73,7 +74,8 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Behaviour<B, S, H> {
local_public_key,
known_addresses,
enable_mdns,
allow_private_ipv4
allow_private_ipv4,
discovery_only_if_under_num,
).await,
events: Vec::new(),
}