@@ -99,7 +99,7 @@ struct InvoiceContents {
9999 fallbacks : Option < Vec < FallbackAddress > > ,
100100 features : Bolt12InvoiceFeatures ,
101101 signing_pubkey : PublicKey ,
102- message_paths : Vec < BlindedMessagePath > ,
102+ held_htlc_available_paths : Vec < BlindedMessagePath > ,
103103 #[ cfg( test) ]
104104 experimental_baz : Option < u64 > ,
105105}
@@ -122,14 +122,17 @@ impl<'a> StaticInvoiceBuilder<'a> {
122122 /// overridden by [`StaticInvoiceBuilder::relative_expiry`].
123123 pub fn for_offer_using_derived_keys < T : secp256k1:: Signing > (
124124 offer : & ' a Offer , payment_paths : Vec < BlindedPaymentPath > ,
125- message_paths : Vec < BlindedMessagePath > , created_at : Duration , expanded_key : & ExpandedKey ,
126- nonce : Nonce , secp_ctx : & Secp256k1 < T > ,
125+ held_htlc_available_paths : Vec < BlindedMessagePath > , created_at : Duration ,
126+ expanded_key : & ExpandedKey , nonce : Nonce , secp_ctx : & Secp256k1 < T > ,
127127 ) -> Result < Self , Bolt12SemanticError > {
128128 if offer. chains ( ) . len ( ) > 1 {
129129 return Err ( Bolt12SemanticError :: UnexpectedChain ) ;
130130 }
131131
132- if payment_paths. is_empty ( ) || message_paths. is_empty ( ) || offer. paths ( ) . is_empty ( ) {
132+ if payment_paths. is_empty ( )
133+ || held_htlc_available_paths. is_empty ( )
134+ || offer. paths ( ) . is_empty ( )
135+ {
133136 return Err ( Bolt12SemanticError :: MissingPaths ) ;
134137 }
135138
@@ -147,8 +150,13 @@ impl<'a> StaticInvoiceBuilder<'a> {
147150 return Err ( Bolt12SemanticError :: InvalidSigningPubkey ) ;
148151 }
149152
150- let invoice =
151- InvoiceContents :: new ( offer, payment_paths, message_paths, created_at, signing_pubkey) ;
153+ let invoice = InvoiceContents :: new (
154+ offer,
155+ payment_paths,
156+ held_htlc_available_paths,
157+ created_at,
158+ signing_pubkey,
159+ ) ;
152160
153161 Ok ( Self { offer_bytes : & offer. bytes , invoice, keys } )
154162 }
@@ -264,8 +272,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
264272
265273 /// Paths to the recipient for indicating that a held HTLC is available to claim when they next
266274 /// come online.
267- pub fn message_paths ( & $self) -> & [ BlindedMessagePath ] {
268- $contents. message_paths ( )
275+ pub fn held_htlc_available_paths ( & $self) -> & [ BlindedMessagePath ] {
276+ $contents. held_htlc_available_paths ( )
269277 }
270278
271279 /// The quantity of items supported, from [`Offer::supported_quantity`].
@@ -438,12 +446,13 @@ impl InvoiceContents {
438446
439447 fn new (
440448 offer : & Offer , payment_paths : Vec < BlindedPaymentPath > ,
441- message_paths : Vec < BlindedMessagePath > , created_at : Duration , signing_pubkey : PublicKey ,
449+ held_htlc_available_paths : Vec < BlindedMessagePath > , created_at : Duration ,
450+ signing_pubkey : PublicKey ,
442451 ) -> Self {
443452 Self {
444453 offer : offer. contents . clone ( ) ,
445454 payment_paths,
446- message_paths ,
455+ held_htlc_available_paths ,
447456 created_at,
448457 relative_expiry : None ,
449458 fallbacks : None ,
@@ -465,7 +474,7 @@ impl InvoiceContents {
465474
466475 let invoice = InvoiceTlvStreamRef {
467476 paths : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |path| path. inner_blinded_path ( ) ) ) ) ,
468- message_paths : Some ( self . message_paths . as_ref ( ) ) ,
477+ held_htlc_available_paths : Some ( self . held_htlc_available_paths . as_ref ( ) ) ,
469478 blindedpay : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |path| & path. payinfo ) ) ) ,
470479 created_at : Some ( self . created_at . as_secs ( ) ) ,
471480 relative_expiry : self . relative_expiry . map ( |duration| duration. as_secs ( ) as u32 ) ,
@@ -519,8 +528,8 @@ impl InvoiceContents {
519528 self . offer . paths ( )
520529 }
521530
522- fn message_paths ( & self ) -> & [ BlindedMessagePath ] {
523- & self . message_paths [ ..]
531+ fn held_htlc_available_paths ( & self ) -> & [ BlindedMessagePath ] {
532+ & self . held_htlc_available_paths [ ..]
524533 }
525534
526535 fn supported_quantity ( & self ) -> Quantity {
@@ -670,7 +679,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
670679 fallbacks,
671680 features,
672681 node_id,
673- message_paths ,
682+ held_htlc_available_paths ,
674683 payment_hash,
675684 amount,
676685 } ,
@@ -689,7 +698,8 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
689698 }
690699
691700 let payment_paths = construct_payment_paths ( blindedpay, paths) ?;
692- let message_paths = message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
701+ let held_htlc_available_paths =
702+ held_htlc_available_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
693703
694704 let created_at = match created_at {
695705 None => return Err ( Bolt12SemanticError :: MissingCreationTime ) ,
@@ -713,7 +723,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
713723 Ok ( InvoiceContents {
714724 offer : OfferContents :: try_from ( ( offer_tlv_stream, experimental_offer_tlv_stream) ) ?,
715725 payment_paths,
716- message_paths ,
726+ held_htlc_available_paths ,
717727 created_at,
718728 relative_expiry,
719729 fallbacks,
@@ -875,7 +885,7 @@ mod tests {
875885 assert_eq ! ( invoice. offer_features( ) , & OfferFeatures :: empty( ) ) ;
876886 assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
877887 assert_eq ! ( invoice. offer_message_paths( ) , & [ blinded_path( ) ] ) ;
878- assert_eq ! ( invoice. message_paths ( ) , & [ blinded_path( ) ] ) ;
888+ assert_eq ! ( invoice. held_htlc_available_paths ( ) , & [ blinded_path( ) ] ) ;
879889 assert_eq ! ( invoice. issuer( ) , None ) ;
880890 assert_eq ! ( invoice. supported_quantity( ) , Quantity :: One ) ;
881891 assert_ne ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -921,7 +931,7 @@ mod tests {
921931 fallbacks: None ,
922932 features: None ,
923933 node_id: Some ( & signing_pubkey) ,
924- message_paths : Some ( & paths) ,
934+ held_htlc_available_paths : Some ( & paths) ,
925935 } ,
926936 SignatureTlvStreamRef { signature: Some ( & invoice. signature( ) ) } ,
927937 ExperimentalOfferTlvStreamRef { experimental_foo: None } ,
@@ -1318,10 +1328,10 @@ mod tests {
13181328 } ,
13191329 }
13201330
1321- // Error if message paths are missing.
1322- let missing_message_paths_invoice = invoice ( ) ;
1323- let mut tlv_stream = missing_message_paths_invoice . as_tlv_stream ( ) ;
1324- tlv_stream. 1 . message_paths = None ;
1331+ // Error if held_htlc_available_paths are missing.
1332+ let missing_held_htlc_available_paths_invoice = invoice ( ) ;
1333+ let mut tlv_stream = missing_held_htlc_available_paths_invoice . as_tlv_stream ( ) ;
1334+ tlv_stream. 1 . held_htlc_available_paths = None ;
13251335 match StaticInvoice :: try_from ( tlv_stream_to_bytes ( & tlv_stream) ) {
13261336 Ok ( _) => panic ! ( "expected error" ) ,
13271337 Err ( e) => {
0 commit comments