fix(nwc): prevent double-count on concurrent pay_invoice reconcile

This commit is contained in:
ajaysehwal
2026-08-01 20:00:09 +05:30
parent 44c6a10753
commit b65f690b87
+6 -1
View File
@@ -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;