@@ -35,6 +35,7 @@ use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs}
3535use crate :: ln:: types:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
3636use crate :: ln:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
3737use crate :: ln:: onion_utils;
38+ use crate :: offers:: invoice_request:: InvoiceRequest ;
3839use crate :: onion_message;
3940use crate :: sign:: { NodeSigner , Recipient } ;
4041
@@ -1790,6 +1791,7 @@ mod fuzzy_internal_msgs {
17901791 payment_context : PaymentContext ,
17911792 intro_node_blinding_point : Option < PublicKey > ,
17921793 keysend_preimage : Option < PaymentPreimage > ,
1794+ invoice_request : Option < InvoiceRequest > ,
17931795 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
17941796 }
17951797 }
@@ -2792,6 +2794,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
27922794 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
27932795 let mut total_msat = None ;
27942796 let mut keysend_preimage: Option < PaymentPreimage > = None ;
2797+ let mut invoice_request: Option < InvoiceRequest > = None ;
27952798 let mut custom_tlvs = Vec :: new ( ) ;
27962799
27972800 let tlv_len = BigSize :: read ( r) ?;
@@ -2805,6 +2808,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28052808 ( 12 , intro_node_blinding_point, option) ,
28062809 ( 16 , payment_metadata, option) ,
28072810 ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2811+ ( ONION_INVREQ_TLV_TYPE , invoice_request, option) ,
28082812 // See https://github.com/lightning/blips/blob/master/blip-0003.md
28092813 ( 5482373484 , keysend_preimage, option)
28102814 } , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2835,7 +2839,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28352839 short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
28362840 } ) } => {
28372841 if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
2838- keysend_preimage. is_some ( )
2842+ keysend_preimage. is_some ( ) || invoice_request . is_some ( )
28392843 {
28402844 return Err ( DecodeError :: InvalidValue )
28412845 }
@@ -2861,21 +2865,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28612865 payment_context,
28622866 intro_node_blinding_point,
28632867 keysend_preimage,
2868+ invoice_request,
28642869 custom_tlvs,
28652870 } )
28662871 } ,
28672872 }
28682873 } else if let Some ( short_channel_id) = short_id {
28692874 if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2870- total_msat. is_some ( )
2875+ total_msat. is_some ( ) || invoice_request . is_some ( )
28712876 { return Err ( DecodeError :: InvalidValue ) }
28722877 Ok ( Self :: Forward {
28732878 short_channel_id,
28742879 amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
28752880 outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
28762881 } )
28772882 } else {
2878- if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) {
2883+ if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request . is_some ( ) {
28792884 return Err ( DecodeError :: InvalidValue )
28802885 }
28812886 if let Some ( data) = & payment_data {
0 commit comments