Skip to content

Commit

Permalink
fix: bolt12 expiry date decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Jan 3, 2025
1 parent 50ee5f7 commit 934a3e5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lightning/lib/bolt12/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ pub unsafe extern "C" fn decode_invoice(invoice: *const c_char) -> CResult<Invoi
Invoice {
amount_sat: convert_msats_to_sats(invoice.amount_msats()),
payment_hash: invoice.payment_hash().0,
expiry_date: invoice
.absolute_expiry()
.and_then(|d| Some(d.as_secs()))
.unwrap_or(0),
expiry_date: (invoice.created_at()
+ invoice.relative_expiry()).as_secs(),
}
}))
}
Expand Down

0 comments on commit 934a3e5

Please sign in to comment.