@@ -1811,6 +1811,15 @@ mod fuzzy_internal_msgs {
18111811 pub outgoing_cltv_value : u32 ,
18121812 }
18131813
1814+ #[ allow( unused) ]
1815+ pub struct InboundTrampolineEntrypointPayload {
1816+ pub amt_to_forward : u64 ,
1817+ pub outgoing_cltv_value : u32 ,
1818+ pub multipath_trampoline_data : Option < FinalOnionHopData > ,
1819+ pub trampoline_packet : TrampolineOnionPacket ,
1820+ pub current_path_key : Option < PublicKey >
1821+ }
1822+
18141823 pub struct InboundOnionReceivePayload {
18151824 pub payment_data : Option < FinalOnionHopData > ,
18161825 pub payment_metadata : Option < Vec < u8 > > ,
@@ -1842,6 +1851,8 @@ mod fuzzy_internal_msgs {
18421851
18431852 pub enum InboundOnionPayload {
18441853 Forward ( InboundOnionForwardPayload ) ,
1854+ #[ allow( unused) ]
1855+ TrampolineEntrypoint ( InboundTrampolineEntrypointPayload ) ,
18451856 Receive ( InboundOnionReceivePayload ) ,
18461857 BlindedForward ( InboundOnionBlindedForwardPayload ) ,
18471858 BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
@@ -2932,6 +2943,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29322943 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
29332944 let mut total_msat = None ;
29342945 let mut keysend_preimage: Option < PaymentPreimage > = None ;
2946+ let mut trampoline_onion_packet: Option < TrampolineOnionPacket > = None ;
29352947 let mut invoice_request: Option < InvoiceRequest > = None ;
29362948 let mut custom_tlvs = Vec :: new ( ) ;
29372949
@@ -2946,6 +2958,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29462958 ( 12 , intro_node_blinding_point, option) ,
29472959 ( 16 , payment_metadata, option) ,
29482960 ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2961+ ( 20 , trampoline_onion_packet, option) ,
29492962 ( 77_777 , invoice_request, option) ,
29502963 // See https://github.com/lightning/blips/blob/master/blip-0003.md
29512964 ( 5482373484 , keysend_preimage, option)
@@ -2962,7 +2975,18 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29622975 return Err ( DecodeError :: InvalidValue )
29632976 }
29642977
2965- if let Some ( blinding_point) = intro_node_blinding_point. or ( update_add_blinding_point) {
2978+ if let Some ( trampoline_onion_packet) = trampoline_onion_packet {
2979+ if payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2980+ total_msat. is_some ( )
2981+ { return Err ( DecodeError :: InvalidValue ) }
2982+ Ok ( Self :: TrampolineEntrypoint ( InboundTrampolineEntrypointPayload {
2983+ amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2984+ outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2985+ multipath_trampoline_data : payment_data,
2986+ trampoline_packet : trampoline_onion_packet,
2987+ current_path_key : intro_node_blinding_point
2988+ } ) )
2989+ } else if let Some ( blinding_point) = intro_node_blinding_point. or ( update_add_blinding_point) {
29662990 if short_id. is_some ( ) || payment_data. is_some ( ) || payment_metadata. is_some ( ) {
29672991 return Err ( DecodeError :: InvalidValue )
29682992 }
0 commit comments