@@ -77,7 +77,7 @@ struct InvoiceContents {
7777 fallbacks : Option < Vec < FallbackAddress > > ,
7878 features : Bolt12InvoiceFeatures ,
7979 signing_pubkey : PublicKey ,
80- message_paths : Vec < BlindedPath > ,
80+ async_receive_message_paths : Vec < BlindedPath > ,
8181}
8282
8383/// Builds a [`StaticInvoice`] from an [`Offer`].
@@ -98,14 +98,17 @@ impl<'a> StaticInvoiceBuilder<'a> {
9898 /// after `created_at`.
9999 pub fn for_offer_using_derived_keys < T : secp256k1:: Signing > (
100100 offer : & ' a Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
101- message_paths : Vec < BlindedPath > , created_at : Duration , expanded_key : & ExpandedKey ,
102- secp_ctx : & Secp256k1 < T > ,
101+ async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
102+ expanded_key : & ExpandedKey , secp_ctx : & Secp256k1 < T > ,
103103 ) -> Result < Self , Bolt12SemanticError > {
104104 if offer. chains ( ) . len ( ) > 1 {
105105 return Err ( Bolt12SemanticError :: UnexpectedChain ) ;
106106 }
107107
108- if payment_paths. is_empty ( ) || message_paths. is_empty ( ) || offer. paths ( ) . is_empty ( ) {
108+ if payment_paths. is_empty ( )
109+ || async_receive_message_paths. is_empty ( )
110+ || offer. paths ( ) . is_empty ( )
111+ {
109112 return Err ( Bolt12SemanticError :: MissingPaths ) ;
110113 }
111114
@@ -123,8 +126,13 @@ impl<'a> StaticInvoiceBuilder<'a> {
123126 return Err ( Bolt12SemanticError :: InvalidSigningPubkey ) ;
124127 }
125128
126- let invoice =
127- InvoiceContents :: new ( offer, payment_paths, message_paths, created_at, signing_pubkey) ;
129+ let invoice = InvoiceContents :: new (
130+ offer,
131+ payment_paths,
132+ async_receive_message_paths,
133+ created_at,
134+ signing_pubkey,
135+ ) ;
128136
129137 Ok ( Self { offer_bytes : & offer. bytes , invoice, keys } )
130138 }
@@ -230,8 +238,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
230238
231239 /// Paths to the recipient for indicating that a held HTLC is available to claim when they next
232240 /// come online.
233- pub fn message_paths ( & $self) -> & [ BlindedPath ] {
234- $contents. message_paths ( )
241+ pub fn async_receive_message_paths ( & $self) -> & [ BlindedPath ] {
242+ $contents. async_receive_message_paths ( )
235243 }
236244
237245 /// The quantity of items supported, from [`Offer::supported_quantity`].
@@ -327,12 +335,13 @@ impl InvoiceContents {
327335
328336 fn new (
329337 offer : & Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
330- message_paths : Vec < BlindedPath > , created_at : Duration , signing_pubkey : PublicKey ,
338+ async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
339+ signing_pubkey : PublicKey ,
331340 ) -> Self {
332341 Self {
333342 offer : offer. contents . clone ( ) ,
334343 payment_paths,
335- message_paths ,
344+ async_receive_message_paths ,
336345 created_at,
337346 relative_expiry : None ,
338347 fallbacks : None ,
@@ -352,7 +361,7 @@ impl InvoiceContents {
352361
353362 let invoice = InvoiceTlvStreamRef {
354363 paths : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( _, path) | path) ) ) ,
355- message_paths : Some ( self . message_paths . as_ref ( ) ) ,
364+ async_receive_message_paths : Some ( self . async_receive_message_paths . as_ref ( ) ) ,
356365 blindedpay : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( payinfo, _) | payinfo) ) ) ,
357366 created_at : Some ( self . created_at . as_secs ( ) ) ,
358367 relative_expiry : self . relative_expiry . map ( |duration| duration. as_secs ( ) as u32 ) ,
@@ -399,8 +408,8 @@ impl InvoiceContents {
399408 self . offer . paths ( )
400409 }
401410
402- fn message_paths ( & self ) -> & [ BlindedPath ] {
403- & self . message_paths [ ..]
411+ fn async_receive_message_paths ( & self ) -> & [ BlindedPath ] {
412+ & self . async_receive_message_paths [ ..]
404413 }
405414
406415 fn supported_quantity ( & self ) -> Quantity {
@@ -510,7 +519,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
510519 fallbacks,
511520 features,
512521 node_id,
513- message_paths ,
522+ async_receive_message_paths ,
514523 payment_hash,
515524 amount,
516525 } ,
@@ -524,7 +533,8 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
524533 }
525534
526535 let payment_paths = construct_payment_paths ( blindedpay, paths) ?;
527- let message_paths = message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
536+ let async_receive_message_paths =
537+ async_receive_message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
528538
529539 let created_at = match created_at {
530540 None => return Err ( Bolt12SemanticError :: MissingCreationTime ) ,
@@ -548,7 +558,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
548558 Ok ( InvoiceContents {
549559 offer : OfferContents :: try_from ( offer_tlv_stream) ?,
550560 payment_paths,
551- message_paths ,
561+ async_receive_message_paths ,
552562 created_at,
553563 relative_expiry,
554564 fallbacks,
@@ -679,7 +689,7 @@ mod tests {
679689 assert_eq ! ( invoice. offer_features( ) , & OfferFeatures :: empty( ) ) ;
680690 assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
681691 assert_eq ! ( invoice. request_paths( ) , & [ blinded_path( ) ] ) ;
682- assert_eq ! ( invoice. message_paths ( ) , & [ blinded_path( ) ] ) ;
692+ assert_eq ! ( invoice. async_receive_message_paths ( ) , & [ blinded_path( ) ] ) ;
683693 assert_eq ! ( invoice. issuer( ) , None ) ;
684694 assert_eq ! ( invoice. supported_quantity( ) , Quantity :: One ) ;
685695 assert_ne ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -726,7 +736,7 @@ mod tests {
726736 fallbacks: None ,
727737 features: None ,
728738 node_id: Some ( & offer_signing_pubkey) ,
729- message_paths : Some ( & paths) ,
739+ async_receive_message_paths : Some ( & paths) ,
730740 } ,
731741 SignatureTlvStreamRef { signature: Some ( & invoice. signature( ) ) } ,
732742 )
@@ -1055,9 +1065,9 @@ mod tests {
10551065 }
10561066
10571067 // Error if message paths are missing.
1058- let missing_message_paths_invoice = invoice ( ) ;
1059- let mut tlv_stream = missing_message_paths_invoice . as_tlv_stream ( ) ;
1060- tlv_stream. 1 . message_paths = None ;
1068+ let missing_async_receive_message_paths_invoice = invoice ( ) ;
1069+ let mut tlv_stream = missing_async_receive_message_paths_invoice . as_tlv_stream ( ) ;
1070+ tlv_stream. 1 . async_receive_message_paths = None ;
10611071 match StaticInvoice :: try_from ( tlv_stream_to_bytes ( & tlv_stream) ) {
10621072 Ok ( _) => panic ! ( "expected error" ) ,
10631073 Err ( e) => {
0 commit comments