@@ -37,6 +37,7 @@ use crate::ln::types::ChannelId;
37
37
use crate :: types:: payment:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
38
38
use crate :: types:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
39
39
use crate :: ln:: onion_utils;
40
+ use crate :: offers:: invoice_request:: InvoiceRequest ;
40
41
use crate :: onion_message;
41
42
use crate :: sign:: { NodeSigner , Recipient } ;
42
43
@@ -1791,6 +1792,7 @@ mod fuzzy_internal_msgs {
1791
1792
payment_context : PaymentContext ,
1792
1793
intro_node_blinding_point : Option < PublicKey > ,
1793
1794
keysend_preimage : Option < PaymentPreimage > ,
1795
+ invoice_request : Option < InvoiceRequest > ,
1794
1796
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
1795
1797
}
1796
1798
}
@@ -2852,6 +2854,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2852
2854
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2853
2855
let mut total_msat = None ;
2854
2856
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2857
+ let mut invoice_request: Option < InvoiceRequest > = None ;
2855
2858
let mut custom_tlvs = Vec :: new ( ) ;
2856
2859
2857
2860
let tlv_len = BigSize :: read ( r) ?;
@@ -2865,6 +2868,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2865
2868
( 12 , intro_node_blinding_point, option) ,
2866
2869
( 16 , payment_metadata, option) ,
2867
2870
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2871
+ ( 77_777 , invoice_request, option) ,
2868
2872
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2869
2873
( 5482373484 , keysend_preimage, option)
2870
2874
} , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2895,7 +2899,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2895
2899
short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
2896
2900
} ) } => {
2897
2901
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 ( )
2899
2903
{
2900
2904
return Err ( DecodeError :: InvalidValue )
2901
2905
}
@@ -2928,21 +2932,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2928
2932
payment_context,
2929
2933
intro_node_blinding_point,
2930
2934
keysend_preimage,
2935
+ invoice_request,
2931
2936
custom_tlvs,
2932
2937
} )
2933
2938
} ,
2934
2939
}
2935
2940
} else if let Some ( short_channel_id) = short_id {
2936
2941
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 ( )
2938
2943
{ return Err ( DecodeError :: InvalidValue ) }
2939
2944
Ok ( Self :: Forward {
2940
2945
short_channel_id,
2941
2946
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2942
2947
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2943
2948
} )
2944
2949
} 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 ( ) {
2946
2951
return Err ( DecodeError :: InvalidValue )
2947
2952
}
2948
2953
if let Some ( data) = & payment_data {
0 commit comments