Skip to content

Commit

Permalink
Identify protocol to populate address book based on response
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Jul 11, 2021
1 parent 2dac75f commit d3b6d3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions protocols/identify/src/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ impl NetworkBehaviour for Identify {
match event {
IdentifyHandlerEvent::Identified(info) => {
let observed = info.observed_addr.clone();
let listen_addresses = info.listen_addrs.clone();

self.events.extend(
listen_addresses
.into_iter()
.map(|address| NetworkBehaviourAction::ReportPeerAddr { peer_id, address })
);
self.events.push_back(
NetworkBehaviourAction::GenerateEvent(
IdentifyEvent::Received {
Expand Down

0 comments on commit d3b6d3c

Please sign in to comment.