Skip to content

Commit

Permalink
Skip nwc invoices that are in-flight
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Oct 26, 2023
1 parent 1493806 commit cdd8d91
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 cdd8d91

Please sign in to comment.