@@ -31,7 +31,7 @@ use bitcoin::{secp256k1, Witness};
3131use bitcoin:: script:: ScriptBuf ;
3232use bitcoin:: hash_types:: Txid ;
3333
34- use crate :: blinded_path:: payment:: { BlindedPaymentTlvs , ForwardTlvs , ReceiveTlvs , UnauthenticatedReceiveTlvs } ;
34+ use crate :: blinded_path:: payment:: { BlindedPaymentTlvs , ForwardTlvs , ReceiveTlvs , TrampolineForwardTlvs , UnauthenticatedReceiveTlvs } ;
3535use crate :: ln:: channelmanager:: Verification ;
3636use crate :: ln:: types:: ChannelId ;
3737use crate :: types:: payment:: { PaymentPreimage , PaymentHash , PaymentSecret } ;
@@ -1844,6 +1844,17 @@ mod fuzzy_internal_msgs {
18441844 pub intro_node_blinding_point : Option < PublicKey > ,
18451845 pub next_blinding_override : Option < PublicKey > ,
18461846 }
1847+
1848+ #[ allow( unused) ]
1849+ pub struct InboundTrampolineBlindedForwardPayload {
1850+ pub outgoing_node_id : NodeId ,
1851+ pub payment_relay : PaymentRelay ,
1852+ pub payment_constraints : PaymentConstraints ,
1853+ pub features : BlindedHopFeatures ,
1854+ pub intro_node_blinding_point : Option < PublicKey > ,
1855+ pub next_blinding_override : Option < PublicKey > ,
1856+ }
1857+
18471858 pub struct InboundOnionBlindedReceivePayload {
18481859 pub sender_intended_htlc_amt_msat : u64 ,
18491860 pub total_msat : u64 ,
@@ -1868,6 +1879,8 @@ mod fuzzy_internal_msgs {
18681879 // These payloads should be seen inside an inner Trampoline onion
18691880 #[ allow( unused) ]
18701881 TrampolineForward ( InboundTrampolineForwardPayload ) ,
1882+ #[ allow( unused) ]
1883+ TrampolineBlindedForward ( InboundTrampolineBlindedForwardPayload ) ,
18711884 }
18721885
18731886 pub ( crate ) enum OutboundOnionPayload < ' a > {
@@ -3028,6 +3041,23 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, NS)> for InboundOnionPayload wh
30283041 next_blinding_override,
30293042 } ) )
30303043 } ,
3044+ ChaChaPolyReadAdapter { readable : BlindedPaymentTlvs :: TrampolineForward ( TrampolineForwardTlvs {
3045+ outgoing_node_id, payment_relay, payment_constraints, features, next_blinding_override
3046+ } ) } => {
3047+ if amt. is_some ( ) || cltv_value. is_some ( ) || total_msat. is_some ( ) ||
3048+ keysend_preimage. is_some ( ) || invoice_request. is_some ( )
3049+ {
3050+ return Err ( DecodeError :: InvalidValue )
3051+ }
3052+ Ok ( Self :: TrampolineBlindedForward ( InboundTrampolineBlindedForwardPayload {
3053+ outgoing_node_id,
3054+ payment_relay,
3055+ payment_constraints,
3056+ features,
3057+ intro_node_blinding_point,
3058+ next_blinding_override,
3059+ } ) )
3060+ } ,
30313061 ChaChaPolyReadAdapter { readable : BlindedPaymentTlvs :: Receive ( receive_tlvs) } => {
30323062 let ReceiveTlvs { tlvs, authentication : ( hmac, nonce) } = receive_tlvs;
30333063 let expanded_key = node_signer. get_inbound_payment_key ( ) ;
0 commit comments