@@ -35,6 +35,7 @@ use crate::blinded_path::payment::{BlindedPaymentTlvs, ForwardTlvs, ReceiveTlvs}
35
35
use crate :: ln:: types:: { ChannelId , PaymentPreimage , PaymentHash , PaymentSecret } ;
36
36
use crate :: ln:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
37
37
use crate :: ln:: onion_utils;
38
+ use crate :: offers:: invoice_request:: InvoiceRequest ;
38
39
use crate :: onion_message;
39
40
use crate :: sign:: { NodeSigner , Recipient } ;
40
41
@@ -1790,6 +1791,7 @@ mod fuzzy_internal_msgs {
1790
1791
payment_context : PaymentContext ,
1791
1792
intro_node_blinding_point : Option < PublicKey > ,
1792
1793
keysend_preimage : Option < PaymentPreimage > ,
1794
+ invoice_request : Option < InvoiceRequest > ,
1793
1795
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
1794
1796
}
1795
1797
}
@@ -2792,6 +2794,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2792
2794
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2793
2795
let mut total_msat = None ;
2794
2796
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2797
+ let mut invoice_request: Option < InvoiceRequest > = None ;
2795
2798
let mut custom_tlvs = Vec :: new ( ) ;
2796
2799
2797
2800
let tlv_len = BigSize :: read ( r) ?;
@@ -2805,6 +2808,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2805
2808
( 12 , intro_node_blinding_point, option) ,
2806
2809
( 16 , payment_metadata, option) ,
2807
2810
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2811
+ ( ONION_INVREQ_TLV_TYPE , invoice_request, option) ,
2808
2812
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2809
2813
( 5482373484 , keysend_preimage, option)
2810
2814
} , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2835,7 +2839,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2835
2839
short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
2836
2840
} ) } => {
2837
2841
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 ( )
2839
2843
{
2840
2844
return Err ( DecodeError :: InvalidValue )
2841
2845
}
@@ -2861,21 +2865,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2861
2865
payment_context,
2862
2866
intro_node_blinding_point,
2863
2867
keysend_preimage,
2868
+ invoice_request,
2864
2869
custom_tlvs,
2865
2870
} )
2866
2871
} ,
2867
2872
}
2868
2873
} else if let Some ( short_channel_id) = short_id {
2869
2874
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 ( )
2871
2876
{ return Err ( DecodeError :: InvalidValue ) }
2872
2877
Ok ( Self :: Forward {
2873
2878
short_channel_id,
2874
2879
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2875
2880
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2876
2881
} )
2877
2882
} 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 ( ) {
2879
2884
return Err ( DecodeError :: InvalidValue )
2880
2885
}
2881
2886
if let Some ( data) = & payment_data {
0 commit comments