Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit e8e22b8

Browse files
committed
Don't save already paid invoices to pending list
1 parent c3a03f9 commit e8e22b8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

mutiny-core/src/nostr/nwc.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,20 @@ impl NostrWalletConnect {
738738
"Payment timeout, not removing payment from budget"
739739
);
740740
}
741+
MutinyError::NonUniquePaymentHash => {
742+
log_warn!(
743+
nostr_manager.logger,
744+
"Already paid invoice, removing payment from budget"
745+
);
746+
budget.remove_payment(&invoice);
747+
self.profile.spending_conditions =
748+
SpendingConditions::Budget(budget);
749+
750+
nostr_manager.save_nwc_profile(self.clone())?;
751+
752+
// don't save to pending list, we already paid it
753+
return Ok(None);
754+
}
741755
_ => {
742756
log_warn!(
743757
nostr_manager.logger,

0 commit comments

Comments
 (0)