Skip to content

Commit 2642df5

Browse files
committed
where is the conn from ourselves coming from??
1 parent dfa9bd8 commit 2642df5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

iroh-gossip/src/net.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ impl Actor {
422422
trace!("handle to_actor {msg:?}");
423423
match msg {
424424
ToActor::ConnIncoming(peer_id, origin, conn) => {
425+
if peer_id == self.endpoint.node_id() {
426+
tracing::error!("Incoming connection from self! How can this happen !!??");
427+
}
425428
self.conns.insert(peer_id, conn.clone());
426429
self.dialer.abort_dial(&peer_id);
427430
let (send_tx, send_rx) = mpsc::channel(SEND_QUEUE_CAP);
@@ -521,6 +524,9 @@ impl Actor {
521524
}
522525
} else {
523526
debug!(peer = ?peer_id, "dial");
527+
if peer_id == self.endpoint.node_id() {
528+
tracing::error!("Trying to dial self, this will fail! and should not happen in the first place !?");
529+
}
524530
self.dialer.queue_dial(peer_id, GOSSIP_ALPN);
525531
// TODO: Enforce max length
526532
self.pending_sends.entry(peer_id).or_default().push(message);
@@ -744,7 +750,7 @@ mod test {
744750
go2.join(topic, vec![pi1]).await.unwrap().await.unwrap();
745751
go3.join(topic, vec![pi1]).await.unwrap().await.unwrap();
746752

747-
let len = 10;
753+
let len = 2;
748754

749755
// subscribe nodes 2 and 3 to the topic
750756
let mut stream2 = go2.subscribe(topic).await.unwrap();

0 commit comments

Comments
 (0)