keep lock longer

This commit is contained in:
Septias
2024-05-18 18:05:44 +02:00
parent e6087db69c
commit b501ab1532

View File

@@ -90,6 +90,7 @@ impl Iroh {
0
};
let mut channels = self.iroh_channels.write().await;
let peers = get_iroh_gossip_peers(ctx, msg_id).await?;
info!(
ctx,
@@ -115,10 +116,7 @@ impl Iroh {
.join(topic, peers.into_iter().map(|addr| addr.node_id).collect())
.await?;
self.iroh_channels
.write()
.await
.insert(topic, ChannelState::new(seq, subscribe_loop));
channels.insert(topic, ChannelState::new(seq, subscribe_loop));
Ok(Some(connect_future))
}