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

Commit

Permalink
Add expired tag to MutinyInvoice
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 5, 2024
1 parent 81634e0 commit 4821fdc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mutiny-wasm/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ pub struct MutinyInvoice {
payee_pubkey: Option<String>,
pub amount_sats: Option<u64>,
pub expire: u64,
pub expired: bool,
status: String,
pub fees_paid: Option<u64>,
pub inbound: bool,
Expand Down Expand Up @@ -181,6 +182,7 @@ impl From<mutiny_core::MutinyInvoice> for MutinyInvoice {
}
None => false,
};
let now = utils::now().as_secs();
MutinyInvoice {
bolt11: m.bolt11,
description: m.description,
Expand All @@ -189,6 +191,7 @@ impl From<mutiny_core::MutinyInvoice> for MutinyInvoice {
payee_pubkey: m.payee_pubkey.map(|p| p.to_hex()),
amount_sats: m.amount_sats,
expire: m.expire,
expired: m.expire < now,
status: m.status.to_string(),
fees_paid: m.fees_paid,
inbound: m.inbound,
Expand Down

0 comments on commit 4821fdc

Please sign in to comment.