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

Commit 4821fdc

Browse files
committed
Add expired tag to MutinyInvoice
1 parent 81634e0 commit 4821fdc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mutiny-wasm/src/models.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub struct MutinyInvoice {
117117
payee_pubkey: Option<String>,
118118
pub amount_sats: Option<u64>,
119119
pub expire: u64,
120+
pub expired: bool,
120121
status: String,
121122
pub fees_paid: Option<u64>,
122123
pub inbound: bool,
@@ -181,6 +182,7 @@ impl From<mutiny_core::MutinyInvoice> for MutinyInvoice {
181182
}
182183
None => false,
183184
};
185+
let now = utils::now().as_secs();
184186
MutinyInvoice {
185187
bolt11: m.bolt11,
186188
description: m.description,
@@ -189,6 +191,7 @@ impl From<mutiny_core::MutinyInvoice> for MutinyInvoice {
189191
payee_pubkey: m.payee_pubkey.map(|p| p.to_hex()),
190192
amount_sats: m.amount_sats,
191193
expire: m.expire,
194+
expired: m.expire < now,
192195
status: m.status.to_string(),
193196
fees_paid: m.fees_paid,
194197
inbound: m.inbound,

0 commit comments

Comments
 (0)