From 2642df5e0ac5a3ddfb88b3a588789ea6728f6e57 Mon Sep 17 00:00:00 2001 From: "Franz Heinzmann (Frando)" Date: Tue, 21 May 2024 12:53:33 +0200 Subject: [PATCH] where is the conn from ourselves coming from?? --- iroh-gossip/src/net.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/iroh-gossip/src/net.rs b/iroh-gossip/src/net.rs index d7fa4778be..94648048d9 100644 --- a/iroh-gossip/src/net.rs +++ b/iroh-gossip/src/net.rs @@ -422,6 +422,9 @@ impl Actor { trace!("handle to_actor {msg:?}"); match msg { ToActor::ConnIncoming(peer_id, origin, conn) => { + if peer_id == self.endpoint.node_id() { + tracing::error!("Incoming connection from self! How can this happen !!??"); + } self.conns.insert(peer_id, conn.clone()); self.dialer.abort_dial(&peer_id); let (send_tx, send_rx) = mpsc::channel(SEND_QUEUE_CAP); @@ -521,6 +524,9 @@ impl Actor { } } else { debug!(peer = ?peer_id, "dial"); + if peer_id == self.endpoint.node_id() { + tracing::error!("Trying to dial self, this will fail! and should not happen in the first place !?"); + } self.dialer.queue_dial(peer_id, GOSSIP_ALPN); // TODO: Enforce max length self.pending_sends.entry(peer_id).or_default().push(message); @@ -744,7 +750,7 @@ mod test { go2.join(topic, vec![pi1]).await.unwrap().await.unwrap(); go3.join(topic, vec![pi1]).await.unwrap().await.unwrap(); - let len = 10; + let len = 2; // subscribe nodes 2 and 3 to the topic let mut stream2 = go2.subscribe(topic).await.unwrap();