From 73e4fd653a3a95eb923f2d08140e9dd1b18c7f1a Mon Sep 17 00:00:00 2001 From: 0x0 Date: Wed, 21 Feb 2024 11:28:46 -0800 Subject: [PATCH 1/2] ch --- protocols/mdns/src/behaviour.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/protocols/mdns/src/behaviour.rs b/protocols/mdns/src/behaviour.rs index 4e3533f26ab..f3fe5ef432b 100644 --- a/protocols/mdns/src/behaviour.rs +++ b/protocols/mdns/src/behaviour.rs @@ -37,6 +37,7 @@ use libp2p_swarm::{ }; use smallvec::SmallVec; use std::collections::hash_map::{Entry, HashMap}; +use std::collections::VecDeque; use std::future::Future; use std::sync::{Arc, RwLock}; use std::{cmp, fmt, io, net::IpAddr, pin::Pin, task::Context, task::Poll, time::Instant}; @@ -347,8 +348,10 @@ where } if !discovered.is_empty() { - let event = Event::Discovered(discovered); - return Poll::Ready(ToSwarm::GenerateEvent(event)); + return Poll::Ready(ToSwarm::NewExternalAddrOfPeer { + peer_id: discovered[0].0, + address: discovered[0].1.clone(), + }); } // Emit expired event. let now = Instant::now(); From 3f1893e44749e682c3ce7c330a7dfec17052c5ca Mon Sep 17 00:00:00 2001 From: 0x0 Date: Wed, 21 Feb 2024 11:30:51 -0800 Subject: [PATCH 2/2] n --- protocols/mdns/src/behaviour.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/protocols/mdns/src/behaviour.rs b/protocols/mdns/src/behaviour.rs index f3fe5ef432b..f5ed51ae08f 100644 --- a/protocols/mdns/src/behaviour.rs +++ b/protocols/mdns/src/behaviour.rs @@ -37,7 +37,6 @@ use libp2p_swarm::{ }; use smallvec::SmallVec; use std::collections::hash_map::{Entry, HashMap}; -use std::collections::VecDeque; use std::future::Future; use std::sync::{Arc, RwLock}; use std::{cmp, fmt, io, net::IpAddr, pin::Pin, task::Context, task::Poll, time::Instant};