Skip to content

Commit

Permalink
protocols/relay: Ignore IdentifyEvent::Error (#2001)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
  • Loading branch information
mxinden and romanb committed Mar 16, 2021
1 parent cd15bc9 commit c6a2104
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions protocols/relay/tests/lib.rs
Expand Up @@ -1112,18 +1112,15 @@ impl NetworkBehaviourEventProcess<KademliaEvent> for CombinedBehaviour {

impl NetworkBehaviourEventProcess<IdentifyEvent> for CombinedBehaviour {
fn inject_event(&mut self, event: IdentifyEvent) {
match event {
IdentifyEvent::Received {
peer_id,
info: IdentifyInfo { listen_addrs, .. },
..
} => {
for addr in listen_addrs {
self.kad.add_address(&peer_id, addr);
}
if let IdentifyEvent::Received {
peer_id,
info: IdentifyInfo { listen_addrs, .. },
..
} = event
{
for addr in listen_addrs {
self.kad.add_address(&peer_id, addr);
}
IdentifyEvent::Sent { .. } => {}
e => panic!("{:?}", e),
}
}
}
Expand Down

0 comments on commit c6a2104

Please sign in to comment.