@@ -37,6 +37,7 @@ use crate::ln::types::ChannelId;
3737use crate :: types:: payment:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
3838use crate :: types:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
3939use crate :: ln:: onion_utils;
40+ use crate :: offers:: invoice_request:: InvoiceRequest ;
4041use crate :: onion_message;
4142use crate :: sign:: { NodeSigner , Recipient } ;
4243
@@ -1791,6 +1792,7 @@ mod fuzzy_internal_msgs {
17911792 payment_context : PaymentContext ,
17921793 intro_node_blinding_point : Option < PublicKey > ,
17931794 keysend_preimage : Option < PaymentPreimage > ,
1795+ invoice_request : Option < InvoiceRequest > ,
17941796 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
17951797 }
17961798 }
@@ -2852,6 +2854,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28522854 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
28532855 let mut total_msat = None ;
28542856 let mut keysend_preimage: Option < PaymentPreimage > = None ;
2857+ let mut invoice_request: Option < InvoiceRequest > = None ;
28552858 let mut custom_tlvs = Vec :: new ( ) ;
28562859
28572860 let tlv_len = BigSize :: read ( r) ?;
@@ -2865,6 +2868,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28652868 ( 12 , intro_node_blinding_point, option) ,
28662869 ( 16 , payment_metadata, option) ,
28672870 ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2871+ ( 77_777 , invoice_request, option) ,
28682872 // See https://github.com/lightning/blips/blob/master/blip-0003.md
28692873 ( 5482373484 , keysend_preimage, option)
28702874 } , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2895,7 +2899,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28952899 short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
28962900 } ) } => {
28972901 if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
2898- keysend_preimage. is_some ( )
2902+ keysend_preimage. is_some ( ) || invoice_request . is_some ( )
28992903 {
29002904 return Err ( DecodeError :: InvalidValue )
29012905 }
@@ -2928,21 +2932,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29282932 payment_context,
29292933 intro_node_blinding_point,
29302934 keysend_preimage,
2935+ invoice_request,
29312936 custom_tlvs,
29322937 } )
29332938 } ,
29342939 }
29352940 } else if let Some ( short_channel_id) = short_id {
29362941 if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2937- total_msat. is_some ( )
2942+ total_msat. is_some ( ) || invoice_request . is_some ( )
29382943 { return Err ( DecodeError :: InvalidValue ) }
29392944 Ok ( Self :: Forward {
29402945 short_channel_id,
29412946 amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
29422947 outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
29432948 } )
29442949 } else {
2945- if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) {
2950+ if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request . is_some ( ) {
29462951 return Err ( DecodeError :: InvalidValue )
29472952 }
29482953 if let Some ( data) = & payment_data {
0 commit comments