Update libp2p-kad and libp2p-secio (#1447)

* Update libp2p-kad and libp2p-secio

* Fix concern
This commit is contained in:
Pierre Krieger
2019-01-16 16:59:24 +01:00
committed by Robert Habermeier
parent c9f047fe84
commit 9018d752dc
2 changed files with 22 additions and 9 deletions
+14 -2
View File
@@ -145,9 +145,21 @@ impl<TSubstream> NetworkBehaviourEventProcess<IdentifyEvent> for Behaviour<TSubs
}
impl<TSubstream> NetworkBehaviourEventProcess<KademliaOut> for Behaviour<TSubstream> {
fn inject_event(&mut self, _: KademliaOut) {
fn inject_event(&mut self, out: KademliaOut) {
// We only ever use Kademlia for discovering nodes, and nodes discovered by Kademlia are
// automatically added to the topology. Therefore we don't need to do anything.
// automatically added to the topology. Therefore we don't need to perform any further
// action.
match out {
KademliaOut::FindNodeResult { key, closer_peers } => {
trace!(target: "sub-libp2p", "Kademlia query for {:?} yielded {:?} results",
key, closer_peers.len());
if closer_peers.is_empty() {
warn!(target: "sub-libp2p", "Kademlia random query has yielded empty results");
}
}
// We never start any GET_PROVIDERS query.
KademliaOut::GetProvidersResult { .. } => ()
}
}
}