From 56ccab371491a1d2b92c3d4ab62242e2baeb6bf9 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 25 Jan 2024 12:51:20 +0000 Subject: [PATCH 1/3] Properly convert to correct type --- mutiny-core/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutiny-core/src/lib.rs b/mutiny-core/src/lib.rs index b6136b776..690cbf7bc 100644 --- a/mutiny-core/src/lib.rs +++ b/mutiny-core/src/lib.rs @@ -1940,7 +1940,7 @@ impl InvoiceHandler for MutinyWallet { } async fn get_outbound_payment_status(&self, payment_hash: &[u8; 32]) -> Option { - self.get_invoice_by_hash(&sha256::Hash::hash(payment_hash)) + self.get_invoice_by_hash(&sha256::Hash::from_inner(*payment_hash)) .await .ok() .map(|p| p.status) From cb3acdbd7fb7b80b06eda8637d801c98ecdfe311 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 25 Jan 2024 12:52:29 +0000 Subject: [PATCH 2/3] Make sure we are connected to relay on NWC creation --- mutiny-core/src/nostr/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mutiny-core/src/nostr/mod.rs b/mutiny-core/src/nostr/mod.rs index 803593da4..b01d4d180 100644 --- a/mutiny-core/src/nostr/mod.rs +++ b/mutiny-core/src/nostr/mod.rs @@ -509,7 +509,10 @@ impl NostrManager { ) -> Result { let profile = self.create_new_profile(profile_type, spending_conditions, tag)?; // add relay if needed - self.client.add_relay(profile.relay.as_str()).await?; + let needs_connect = self.client.add_relay(profile.relay.as_str()).await?; + if needs_connect { + self.client.connect_relay(profile.relay.as_str()).await?; + } let info_event = self.nwc.read().unwrap().iter().find_map(|nwc| { if nwc.profile.index == profile.index { From 5f3191e88492eb3196f35703327a67b6183f2b14 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 25 Jan 2024 12:57:11 +0000 Subject: [PATCH 3/3] Add one to filter timestamps --- mutiny-core/src/nostr/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutiny-core/src/nostr/mod.rs b/mutiny-core/src/nostr/mod.rs index b01d4d180..78ef4f905 100644 --- a/mutiny-core/src/nostr/mod.rs +++ b/mutiny-core/src/nostr/mod.rs @@ -140,7 +140,7 @@ impl NostrManager { self.storage.set_nwc_sync_time(now.as_u64())?; now } - Some(time) => Timestamp::from(time), + Some(time) => Timestamp::from(time + 1), // add one so we get only new events }; let vec = self @@ -168,7 +168,7 @@ impl NostrManager { self.storage.set_dm_sync_time(now.as_u64())?; now } - Some(time) => Timestamp::from(time), + Some(time) => Timestamp::from(time + 1), // add one so we get only new events }; let received_dm_filter = Filter::new()