Skip to content

Commit

Permalink
Fixup connections read locks
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcaseria committed Sep 21, 2024
1 parent bd9b5bb commit 9e7e258
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/cdk-nostr/src/nwc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ impl NostrWalletConnect {
if connections.is_empty() {
return Ok(());
}
drop(connections);

self.ensure_relays_connected().await?;
let event = EventBuilder::new(Kind::WalletConnectInfo, "pay_invoice get_balance", vec![])
.to_event(&self.keys)?;
Expand Down Expand Up @@ -208,6 +210,8 @@ impl NostrWalletConnect {
.iter()
.map(|conn| conn.relay.clone())
.collect::<HashSet<_>>();
drop(connections);

tracing::debug!("Relays: {:?}", urls);
for url in &urls {
if let Ok(relay) = self.client.relay(url).await {
Expand Down

0 comments on commit 9e7e258

Please sign in to comment.