@@ -1811,6 +1811,17 @@ 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+ /// The blinding point this hop needs to decrypt its Trampoline onion.
1821+ /// This is used for Trampoline hops that are not the blinded path intro hop.
1822+ pub current_path_key : Option < PublicKey >
1823+ }
1824+
18141825 pub struct InboundOnionReceivePayload {
18151826 pub payment_data : Option < FinalOnionHopData > ,
18161827 pub payment_metadata : Option < Vec < u8 > > ,
@@ -1842,6 +1853,8 @@ mod fuzzy_internal_msgs {
18421853
18431854 pub enum InboundOnionPayload {
18441855 Forward ( InboundOnionForwardPayload ) ,
1856+ #[ allow( unused) ]
1857+ TrampolineEntrypoint ( InboundTrampolineEntrypointPayload ) ,
18451858 Receive ( InboundOnionReceivePayload ) ,
18461859 BlindedForward ( InboundOnionBlindedForwardPayload ) ,
18471860 BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
@@ -2932,6 +2945,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29322945 let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
29332946 let mut total_msat = None ;
29342947 let mut keysend_preimage: Option < PaymentPreimage > = None ;
2948+ let mut trampoline_onion_packet: Option < TrampolineOnionPacket > = None ;
29352949 let mut invoice_request: Option < InvoiceRequest > = None ;
29362950 let mut custom_tlvs = Vec :: new ( ) ;
29372951
@@ -2946,6 +2960,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29462960 ( 12 , intro_node_blinding_point, option) ,
29472961 ( 16 , payment_metadata, option) ,
29482962 ( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2963+ ( 20 , trampoline_onion_packet, option) ,
29492964 ( 77_777 , invoice_request, option) ,
29502965 // See https://github.com/lightning/blips/blob/master/blip-0003.md
29512966 ( 5482373484 , keysend_preimage, option)
@@ -2962,7 +2977,18 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
29622977 return Err ( DecodeError :: InvalidValue )
29632978 }
29642979
2965- if let Some ( blinding_point) = intro_node_blinding_point. or ( update_add_blinding_point) {
2980+ if let Some ( trampoline_onion_packet) = trampoline_onion_packet {
2981+ if payment_metadata. is_some ( ) || encrypted_tlvs_opt. is_some ( ) ||
2982+ total_msat. is_some ( )
2983+ { return Err ( DecodeError :: InvalidValue ) }
2984+ Ok ( Self :: TrampolineEntrypoint ( InboundTrampolineEntrypointPayload {
2985+ amt_to_forward : amt. ok_or ( DecodeError :: InvalidValue ) ?,
2986+ outgoing_cltv_value : cltv_value. ok_or ( DecodeError :: InvalidValue ) ?,
2987+ multipath_trampoline_data : payment_data,
2988+ trampoline_packet : trampoline_onion_packet,
2989+ current_path_key : intro_node_blinding_point
2990+ } ) )
2991+ } else if let Some ( blinding_point) = intro_node_blinding_point. or ( update_add_blinding_point) {
29662992 if short_id. is_some ( ) || payment_data. is_some ( ) || payment_metadata. is_some ( ) {
29672993 return Err ( DecodeError :: InvalidValue )
29682994 }
0 commit comments