@@ -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
@@ -1740,6 +1741,7 @@ mod fuzzy_internal_msgs {
1740
1741
payment_context : PaymentContext ,
1741
1742
intro_node_blinding_point : Option < PublicKey > ,
1742
1743
keysend_preimage : Option < PaymentPreimage > ,
1744
+ invoice_request : Option < InvoiceRequest > ,
1743
1745
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
1744
1746
}
1745
1747
}
@@ -2724,6 +2726,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
2724
2726
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2725
2727
let mut total_msat = None ;
2726
2728
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2729
+ let mut invoice_request: Option < InvoiceRequest > = None ;
2727
2730
let mut custom_tlvs = Vec :: new ( ) ;
2728
2731
2729
2732
let tlv_len = BigSize :: read ( r) ?;
@@ -2737,6 +2740,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
2737
2740
( 12 , intro_node_blinding_point, option) ,
2738
2741
( 16 , payment_metadata, option) ,
2739
2742
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2743
+ ( 77_777 , invoice_request, option) ,
2740
2744
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2741
2745
( 5482373484 , keysend_preimage, option)
2742
2746
} , |msg_type: u64 , msg_reader: & mut FixedLengthReader <_>| -> Result <bool , DecodeError > {
@@ -2767,7 +2771,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
2767
2771
short_channel_id, payment_relay, payment_constraints, features
2768
2772
} ) } => {
2769
2773
if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
2770
- keysend_preimage. is_some ( )
2774
+ keysend_preimage. is_some ( ) || invoice_request . is_some ( )
2771
2775
{
2772
2776
return Err ( DecodeError :: InvalidValue )
2773
2777
}
@@ -2792,21 +2796,22 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
2792
2796
payment_context,
2793
2797
intro_node_blinding_point,
2794
2798
keysend_preimage,
2799
+ invoice_request,
2795
2800
custom_tlvs,
2796
2801
} )
2797
2802
} ,
2798
2803
}
2799
2804
} else if let Some ( short_channel_id) = short_id {
2800
2805
if payment_data. is_some ( ) || payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2801
- total_msat. is_some ( )
2806
+ total_msat. is_some ( ) || invoice_request . is_some ( )
2802
2807
{ return Err ( DecodeError :: InvalidValue ) }
2803
2808
Ok ( Self :: Forward {
2804
2809
short_channel_id,
2805
2810
amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2806
2811
outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2807
2812
} )
2808
2813
} else {
2809
- if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) {
2814
+ if encrypted_tlvs_opt. is_some ( ) || total_msat. is_some ( ) || invoice_request . is_some ( ) {
2810
2815
return Err ( DecodeError :: InvalidValue )
2811
2816
}
2812
2817
if let Some ( data) = & payment_data {
0 commit comments