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

Commit cdd8d91

Browse files
committed
Skip nwc invoices that are in-flight
1 parent 1493806 commit cdd8d91

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

mutiny-core/src/nostr/nwc.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,12 @@ impl NostrWalletConnect {
371371
return Ok(None);
372372
}
373373

374-
// if we have already paid this invoice, skip it
374+
// if we have already paid or are attempting to pay this invoice, skip it
375375
let node = node_manager.get_node(from_node).await?;
376-
if node.get_invoice(&invoice).is_ok_and(|i| i.paid()) {
376+
if node
377+
.get_invoice(&invoice)
378+
.is_ok_and(|i| matches!(i.status, HTLCStatus::Succeeded | HTLCStatus::InFlight))
379+
{
377380
return Ok(None);
378381
}
379382
drop(node);

0 commit comments

Comments
 (0)