@@ -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`].
@@ -101,14 +101,17 @@ impl<'a> StaticInvoiceBuilder<'a> {
101101 /// after `created_at`.
102102 pub fn for_offer_using_derived_keys < T : secp256k1:: Signing > (
103103 offer : & ' a Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
104- message_paths : Vec < BlindedPath > , created_at : Duration , expanded_key : & ExpandedKey ,
105- secp_ctx : & Secp256k1 < T > ,
104+ async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
105+ expanded_key : & ExpandedKey , secp_ctx : & Secp256k1 < T > ,
106106 ) -> Result < Self , Bolt12SemanticError > {
107107 if offer. chains ( ) . len ( ) > 1 {
108108 return Err ( Bolt12SemanticError :: UnexpectedChain ) ;
109109 }
110110
111- if payment_paths. is_empty ( ) || message_paths. is_empty ( ) || offer. paths ( ) . is_empty ( ) {
111+ if payment_paths. is_empty ( )
112+ || async_receive_message_paths. is_empty ( )
113+ || offer. paths ( ) . is_empty ( )
114+ {
112115 return Err ( Bolt12SemanticError :: MissingPaths ) ;
113116 }
114117
@@ -126,8 +129,13 @@ impl<'a> StaticInvoiceBuilder<'a> {
126129 return Err ( Bolt12SemanticError :: InvalidSigningPubkey ) ;
127130 }
128131
129- let invoice =
130- InvoiceContents :: new ( offer, payment_paths, message_paths, created_at, signing_pubkey) ;
132+ let invoice = InvoiceContents :: new (
133+ offer,
134+ payment_paths,
135+ async_receive_message_paths,
136+ created_at,
137+ signing_pubkey,
138+ ) ;
131139
132140 Ok ( Self { offer_bytes : & offer. bytes , invoice, keys } )
133141 }
@@ -233,8 +241,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
233241
234242 /// Paths to the recipient for indicating that a held HTLC is available to claim when they next
235243 /// come online.
236- pub fn message_paths ( & $self) -> & [ BlindedPath ] {
237- $contents. message_paths ( )
244+ pub fn async_receive_message_paths ( & $self) -> & [ BlindedPath ] {
245+ $contents. async_receive_message_paths ( )
238246 }
239247
240248 /// The quantity of items supported, from [`Offer::supported_quantity`].
@@ -330,12 +338,13 @@ impl InvoiceContents {
330338
331339 fn new (
332340 offer : & Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
333- message_paths : Vec < BlindedPath > , created_at : Duration , signing_pubkey : PublicKey ,
341+ async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
342+ signing_pubkey : PublicKey ,
334343 ) -> Self {
335344 Self {
336345 offer : offer. contents . clone ( ) ,
337346 payment_paths,
338- message_paths ,
347+ async_receive_message_paths ,
339348 created_at,
340349 relative_expiry : None ,
341350 fallbacks : None ,
@@ -355,7 +364,7 @@ impl InvoiceContents {
355364
356365 let invoice = InvoiceTlvStreamRef {
357366 paths : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( _, path) | path) ) ) ,
358- message_paths : Some ( self . message_paths . as_ref ( ) ) ,
367+ async_receive_message_paths : Some ( self . async_receive_message_paths . as_ref ( ) ) ,
359368 blindedpay : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( payinfo, _) | payinfo) ) ) ,
360369 created_at : Some ( self . created_at . as_secs ( ) ) ,
361370 relative_expiry : self . relative_expiry . map ( |duration| duration. as_secs ( ) as u32 ) ,
@@ -402,8 +411,8 @@ impl InvoiceContents {
402411 self . offer . paths ( )
403412 }
404413
405- fn message_paths ( & self ) -> & [ BlindedPath ] {
406- & self . message_paths [ ..]
414+ fn async_receive_message_paths ( & self ) -> & [ BlindedPath ] {
415+ & self . async_receive_message_paths [ ..]
407416 }
408417
409418 fn supported_quantity ( & self ) -> Quantity {
@@ -514,7 +523,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
514523 fallbacks,
515524 features,
516525 node_id,
517- message_paths ,
526+ async_receive_message_paths ,
518527 payment_hash,
519528 amount,
520529 } ,
@@ -528,7 +537,8 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
528537 }
529538
530539 let payment_paths = construct_payment_paths ( blindedpay, paths) ?;
531- let message_paths = message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
540+ let async_receive_message_paths =
541+ async_receive_message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
532542
533543 let created_at = match created_at {
534544 None => return Err ( Bolt12SemanticError :: MissingCreationTime ) ,
@@ -552,7 +562,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
552562 Ok ( InvoiceContents {
553563 offer : OfferContents :: try_from ( offer_tlv_stream) ?,
554564 payment_paths,
555- message_paths ,
565+ async_receive_message_paths ,
556566 created_at,
557567 relative_expiry,
558568 fallbacks,
@@ -683,7 +693,7 @@ mod tests {
683693 assert_eq ! ( invoice. offer_features( ) , & OfferFeatures :: empty( ) ) ;
684694 assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
685695 assert_eq ! ( invoice. request_paths( ) , & [ blinded_path( ) ] ) ;
686- assert_eq ! ( invoice. message_paths ( ) , & [ blinded_path( ) ] ) ;
696+ assert_eq ! ( invoice. async_receive_message_paths ( ) , & [ blinded_path( ) ] ) ;
687697 assert_eq ! ( invoice. issuer( ) , None ) ;
688698 assert_eq ! ( invoice. supported_quantity( ) , Quantity :: One ) ;
689699 assert_ne ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -730,7 +740,7 @@ mod tests {
730740 fallbacks: None ,
731741 features: None ,
732742 node_id: Some ( & offer_signing_pubkey) ,
733- message_paths : Some ( & paths) ,
743+ async_receive_message_paths : Some ( & paths) ,
734744 } ,
735745 SignatureTlvStreamRef { signature: Some ( & invoice. signature( ) ) } ,
736746 )
@@ -1059,9 +1069,9 @@ mod tests {
10591069 }
10601070
10611071 // Error if message paths are missing.
1062- let missing_message_paths_invoice = invoice ( ) ;
1063- let mut tlv_stream = missing_message_paths_invoice . as_tlv_stream ( ) ;
1064- tlv_stream. 1 . message_paths = None ;
1072+ let missing_async_receive_message_paths_invoice = invoice ( ) ;
1073+ let mut tlv_stream = missing_async_receive_message_paths_invoice . as_tlv_stream ( ) ;
1074+ tlv_stream. 1 . async_receive_message_paths = None ;
10651075 match StaticInvoice :: try_from ( tlv_stream_to_bytes ( & tlv_stream) ) {
10661076 Ok ( _) => panic ! ( "expected error" ) ,
10671077 Err ( e) => {
0 commit comments