@@ -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
@@ -1776,6 +1777,7 @@ mod fuzzy_internal_msgs {
17761777 payment_context : PaymentContext ,
17771778 intro_node_blinding_point : Option < PublicKey > ,
17781779 keysend_preimage : Option < PaymentPreimage > ,
1780+ invoice_request : Option < InvoiceRequest > ,
17791781 custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
17801782 }
17811783 }
@@ -2778,6 +2780,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
27782780 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
27792781 let mut total_msat = None ;
27802782 let mut keysend_preimage: Option < PaymentPreimage > = None ;
2783+ let mut invoice_request: Option < InvoiceRequest > = None ;
27812784 let mut custom_tlvs = Vec :: new ( ) ;
27822785
27832786 let tlv_len = BigSize :: read ( r) ?;
@@ -2791,6 +2794,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
27912794 ( 12 , intro_node_blinding_point, option) ,
27922795 ( 16 , payment_metadata, option) ,
27932796 ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2797+ ( ONION_INVREQ_TLV_TYPE , invoice_request, option) ,
27942798 // See https://github.com/lightning/blips/blob/master/blip-0003.md
27952799 ( 5482373484 , keysend_preimage, option)
27962800 } , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2821,7 +2825,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28212825 short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
28222826 } ) } => {
28232827 if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
2824- keysend_preimage. is_some ( )
2828+ keysend_preimage. is_some ( ) || invoice_request . is_some ( )
28252829 {
28262830 return Err ( DecodeError :: InvalidValue )
28272831 }
@@ -2847,21 +2851,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
28472851 payment_context,
28482852 intro_node_blinding_point,
28492853 keysend_preimage,
2854+ invoice_request,
28502855 custom_tlvs,
28512856 } )
28522857 } ,
28532858 }
28542859 } else if let Some ( short_channel_id) = short_id {
28552860 if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2856- total_msat. is_some ( )
2861+ total_msat. is_some ( ) || invoice_request . is_some ( )
28572862 { return Err ( DecodeError :: InvalidValue ) }
28582863 Ok ( Self :: Forward {
28592864 short_channel_id,
28602865 amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
28612866 outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
28622867 } )
28632868 } else {
2864- if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) {
2869+ if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request . is_some ( ) {
28652870 return Err ( DecodeError :: InvalidValue )
28662871 }
28672872 if let Some ( data) = & payment_data {
0 commit comments