Skip to content

Commit 913d2c4

Browse files
committed
fix: do not wait for connections in maybe_add_gossip_peers()
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
1 parent e32d676 commit 913d2c4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/peer_channels.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ impl Iroh {
143143
self.endpoint.add_node_addr(peer.clone())?;
144144
}
145145

146-
self.gossip
147-
.join(topic, peers.into_iter().map(|peer| peer.node_id).collect())
148-
.await?;
146+
self.gossip.join_with_opts(
147+
topic,
148+
JoinOptions::with_bootstrap(peers.into_iter().map(|peer| peer.node_id)),
149+
);
149150
}
150151
Ok(())
151152
}

0 commit comments

Comments
 (0)