@@ -1811,6 +1811,17 @@ mod fuzzy_internal_msgs {
1811
1811
pub outgoing_cltv_value : u32 ,
1812
1812
}
1813
1813
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
+
1814
1825
pub struct InboundOnionReceivePayload {
1815
1826
pub payment_data : Option < FinalOnionHopData > ,
1816
1827
pub payment_metadata : Option < Vec < u8 > > ,
@@ -1842,6 +1853,8 @@ mod fuzzy_internal_msgs {
1842
1853
1843
1854
pub enum InboundOnionPayload {
1844
1855
Forward ( InboundOnionForwardPayload ) ,
1856
+ #[ allow( unused) ]
1857
+ TrampolineEntrypoint ( InboundTrampolineEntrypointPayload ) ,
1845
1858
Receive ( InboundOnionReceivePayload ) ,
1846
1859
BlindedForward ( InboundOnionBlindedForwardPayload ) ,
1847
1860
BlindedReceive ( InboundOnionBlindedReceivePayload ) ,
@@ -2932,6 +2945,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2932
2945
let mut payment_metadata: Option < WithoutLength < Vec < u8 > > > = None ;
2933
2946
let mut total_msat = None ;
2934
2947
let mut keysend_preimage: Option < PaymentPreimage > = None ;
2948
+ let mut trampoline_onion_packet: Option < TrampolineOnionPacket > = None ;
2935
2949
let mut invoice_request: Option < InvoiceRequest > = None ;
2936
2950
let mut custom_tlvs = Vec :: new ( ) ;
2937
2951
@@ -2946,6 +2960,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2946
2960
( 12 , intro_node_blinding_point, option) ,
2947
2961
( 16 , payment_metadata, option) ,
2948
2962
( 18 , total_msat, ( option, encoding: ( u64 , HighZeroBytesDroppedBigSize ) ) ) ,
2963
+ ( 20 , trampoline_onion_packet, option) ,
2949
2964
( 77_777 , invoice_request, option) ,
2950
2965
// See https://github.com/lightning/blips/blob/master/blip-0003.md
2951
2966
( 5482373484 , keysend_preimage, option)
@@ -2962,7 +2977,18 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
2962
2977
return Err ( DecodeError :: InvalidValue )
2963
2978
}
2964
2979
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) {
2966
2992
if short_id. is_some ( ) || payment_data. is_some ( ) || payment_metadata. is_some ( ) {
2967
2993
return Err ( DecodeError :: InvalidValue )
2968
2994
}
0 commit comments