@@ -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
@@ -1776,6 +1777,7 @@ mod fuzzy_internal_msgs {
1776
1777
payment_context : PaymentContext ,
1777
1778
intro_node_blinding_point : Option < PublicKey > ,
1778
1779
keysend_preimage : Option < PaymentPreimage > ,
1780
+ invoice_request : Option < InvoiceRequest > ,
1779
1781
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
1780
1782
}
1781
1783
}
@@ -2775,6 +2777,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2775
2777
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2776
2778
let mut total_msat = None ;
2777
2779
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2780
+ let mut invoice_request: Option < InvoiceRequest > = None ;
2778
2781
let mut custom_tlvs = Vec :: new ( ) ;
2779
2782
2780
2783
let tlv_len = BigSize :: read ( r) ?;
@@ -2788,6 +2791,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2788
2791
( 12 , intro_node_blinding_point, option) ,
2789
2792
( 16 , payment_metadata, option) ,
2790
2793
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2794
+ ( 77_777 , invoice_request, option) ,
2791
2795
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2792
2796
( 5482373484 , keysend_preimage, option)
2793
2797
} , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2818,7 +2822,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2818
2822
short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
2819
2823
} ) } => {
2820
2824
if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
2821
- keysend_preimage. is_some ( )
2825
+ keysend_preimage. is_some ( ) || invoice_request . is_some ( )
2822
2826
{
2823
2827
return Err ( DecodeError :: InvalidValue )
2824
2828
}
@@ -2844,21 +2848,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2844
2848
payment_context,
2845
2849
intro_node_blinding_point,
2846
2850
keysend_preimage,
2851
+ invoice_request,
2847
2852
custom_tlvs,
2848
2853
} )
2849
2854
} ,
2850
2855
}
2851
2856
} else if let Some ( short_channel_id) = short_id {
2852
2857
if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2853
- total_msat. is_some ( )
2858
+ total_msat. is_some ( ) || invoice_request . is_some ( )
2854
2859
{ return Err ( DecodeError :: InvalidValue ) }
2855
2860
Ok ( Self :: Forward {
2856
2861
short_channel_id,
2857
2862
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2858
2863
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2859
2864
} )
2860
2865
} else {
2861
- if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) {
2866
+ if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request . is_some ( ) {
2862
2867
return Err ( DecodeError :: InvalidValue )
2863
2868
}
2864
2869
if let Some ( data) = & payment_data {
0 commit comments