mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
fix: only add node addrs with actual information
This commit is contained in:
@@ -103,21 +103,22 @@ impl Iroh {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let peers = get_iroh_gossip_peers(ctx, msg_id).await?;
|
let peers = get_iroh_gossip_peers(ctx, msg_id).await?;
|
||||||
|
let node_ids = peers.iter().map(|p| p.node_id).collect::<Vec<_>>();
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
ctx,
|
ctx,
|
||||||
"IROH_REALTIME: Joining gossip with peers: {:?}",
|
"IROH_REALTIME: Joining gossip with peers: {:?}", node_ids,
|
||||||
peers.iter().map(|p| p.node_id).collect::<Vec<_>>()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Connect to all peers
|
// Inform iroh of potentially new node addresses
|
||||||
for peer in &peers {
|
for node_addr in &peers {
|
||||||
self.endpoint.add_node_addr(peer.clone())?;
|
if !node_addr.info.is_empty() {
|
||||||
|
self.endpoint.add_node_addr(node_addr.clone())?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let connect_future = self
|
// Connect to all peers
|
||||||
.gossip
|
let connect_future = self.gossip.join(topic, node_ids).await?;
|
||||||
.join(topic, peers.into_iter().map(|addr| addr.node_id).collect())
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
let ctx = ctx.clone();
|
let ctx = ctx.clone();
|
||||||
let gossip = self.gossip.clone();
|
let gossip = self.gossip.clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user