Skip to content

Commit 821c79d

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 854d650 commit 821c79d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning-invoice/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,11 @@ impl From<PositiveTimestamp> for SystemTime {
10261026
}
10271027

10281028
impl Invoice {
1029+
/// The hash of the [`RawInvoice`] that was signed.
1030+
pub fn signable_hash(&self) -> [u8; 32] {
1031+
self.signed_invoice.hash
1032+
}
1033+
10291034
/// Transform the `Invoice` into it's unchecked version
10301035
pub fn into_signed_raw(self) -> SignedRawInvoice {
10311036
self.signed_invoice

0 commit comments

Comments
 (0)