Skip to content

Commit

Permalink
fix: do not wait for connections in maybe_add_gossip_peers()
Browse files Browse the repository at this point in the history
join() method of Gossip [1]
waits for at least one connection
and this is not what we want
because it may block receive_imf()
forever if no connection arrives.

[1] https://docs.rs/iroh-gossip/0.25.0/iroh_gossip/net/struct.Gossip.html#method.join
  • Loading branch information
link2xt committed Oct 24, 2024
1 parent e32d676 commit 913d2c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/peer_channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ impl Iroh {
self.endpoint.add_node_addr(peer.clone())?;
}

self.gossip
.join(topic, peers.into_iter().map(|peer| peer.node_id).collect())
.await?;
self.gossip.join_with_opts(
topic,
JoinOptions::with_bootstrap(peers.into_iter().map(|peer| peer.node_id)),
);
}
Ok(())
}
Expand Down

0 comments on commit 913d2c4

Please sign in to comment.