From b65f690b87019b1b9db7b4888acfa4934e173fb5 Mon Sep 17 00:00:00 2001 From: ajaysehwal Date: Sat, 1 Aug 2026 20:00:09 +0530 Subject: [PATCH] fix(nwc): prevent double-count on concurrent pay_invoice reconcile --- stores/NostrWalletConnectStore.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stores/NostrWalletConnectStore.ts b/stores/NostrWalletConnectStore.ts index d23b6cf49..3e708a32a 100644 --- a/stores/NostrWalletConnectStore.ts +++ b/stores/NostrWalletConnectStore.ts @@ -2313,8 +2313,10 @@ export default class NostrWalletConnectStore { ); if (!payment) continue; - changed = true; + let reconciled = false; runInAction(() => { + if (activity.status !== 'pending') return; + reconciled = true; activity.payment = new Payment(payment); if (!payment.isIncomplete) { activity.status = 'success'; @@ -2328,6 +2330,9 @@ export default class NostrWalletConnectStore { activity.status = 'failed'; } }); + if (reconciled) { + changed = true; + } } if (changed) { this.lookupPaymentsCache = null;