Skip to content

Commit 8523ed1

Browse files
committed
Expose a BOLT 11 Invoice's signable_hash
Otherwise, an Invoice must first be converted to a SignedRawInvoice to obtain the hash.
1 parent 48fa2fd commit 8523ed1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning-invoice/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,11 @@ impl From<PositiveTimestamp> for SystemTime {
10211021
}
10221022

10231023
impl Invoice {
1024+
/// The hash of the `RawInvoice` that was signed.
1025+
pub fn signable_hash(&self) -> [u8; 32] {
1026+
self.signed_invoice.hash
1027+
}
1028+
10241029
/// Transform the `Invoice` into it's unchecked version
10251030
pub fn into_signed_raw(self) -> SignedRawInvoice {
10261031
self.signed_invoice

0 commit comments

Comments
 (0)