mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
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
This commit is contained in:
@@ -143,9 +143,10 @@ impl Iroh {
|
|||||||
self.endpoint.add_node_addr(peer.clone())?;
|
self.endpoint.add_node_addr(peer.clone())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.gossip
|
self.gossip.join_with_opts(
|
||||||
.join(topic, peers.into_iter().map(|peer| peer.node_id).collect())
|
topic,
|
||||||
.await?;
|
JoinOptions::with_bootstrap(peers.into_iter().map(|peer| peer.node_id)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user