Skip to content

Commit

Permalink
Merge pull request #809 from MutinyWallet/skip-inflight-nwc-payments
Browse files Browse the repository at this point in the history
Skip nwc invoices that are in-flight
  • Loading branch information
TonyGiorgio authored Oct 26, 2023
2 parents 1493806 + cdd8d91 commit b214af8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mutiny-core/src/nostr/nwc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,12 @@ impl NostrWalletConnect {
return Ok(None);
}

// if we have already paid this invoice, skip it
// if we have already paid or are attempting to pay this invoice, skip it
let node = node_manager.get_node(from_node).await?;
if node.get_invoice(&invoice).is_ok_and(|i| i.paid()) {
if node
.get_invoice(&invoice)
.is_ok_and(|i| matches!(i.status, HTLCStatus::Succeeded | HTLCStatus::InFlight))
{
return Ok(None);
}
drop(node);
Expand Down

0 comments on commit b214af8

Please sign in to comment.