Skip to content

Commit

Permalink
where is the conn from ourselves coming from??
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed May 21, 2024
1 parent dfa9bd8 commit 2642df5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion iroh-gossip/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2642df5

Please sign in to comment.