@@ -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
}
@@ -2778,6 +2780,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2778
2780
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2779
2781
let mut total_msat = None ;
2780
2782
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2783
+ let mut invoice_request: Option < InvoiceRequest > = None ;
2781
2784
let mut custom_tlvs = Vec :: new ( ) ;
2782
2785
2783
2786
let tlv_len = BigSize :: read ( r) ?;
@@ -2791,6 +2794,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2791
2794
( 12 , intro_node_blinding_point, option) ,
2792
2795
( 16 , payment_metadata, option) ,
2793
2796
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2797
+ ( ONION_INVREQ_TLV_TYPE , invoice_request, option) ,
2794
2798
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2795
2799
( 5482373484 , keysend_preimage, option)
2796
2800
} , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2821,7 +2825,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2821
2825
short_channel_id, payment_relay, payment_constraints, features, next_blinding_override
2822
2826
} ) } => {
2823
2827
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 ( )
2825
2829
{
2826
2830
return Err ( DecodeError :: InvalidValue )
2827
2831
}
@@ -2847,21 +2851,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2847
2851
payment_context,
2848
2852
intro_node_blinding_point,
2849
2853
keysend_preimage,
2854
+ invoice_request,
2850
2855
custom_tlvs,
2851
2856
} )
2852
2857
} ,
2853
2858
}
2854
2859
} else if let Some ( short_channel_id) = short_id {
2855
2860
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 ( )
2857
2862
{ return Err ( DecodeError :: InvalidValue ) }
2858
2863
Ok ( Self :: Forward {
2859
2864
short_channel_id,
2860
2865
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2861
2866
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2862
2867
} )
2863
2868
} 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 ( ) {
2865
2870
return Err ( DecodeError :: InvalidValue )
2866
2871
}
2867
2872
if let Some ( data) = & payment_data {
0 commit comments