@@ -1740,6 +1740,17 @@ mod fuzzy_internal_msgs {
17401740 }
17411741 }
17421742
1743+ pub ( crate ) enum OutboundTrampolinePayload {
1744+ #[ allow( unused) ]
1745+ Forward {
1746+ /// The value, in msat, of the payment after this hop's fee is deducted.
1747+ amt_to_forward : u64 ,
1748+ outgoing_cltv_value : u32 ,
1749+ /// The node id to which the trampoline node must find a route
1750+ outgoing_node_id : PublicKey ,
1751+ }
1752+ }
1753+
17431754 pub struct DecodedOnionErrorPacket {
17441755 pub ( crate ) hmac : [ u8 ; 32 ] ,
17451756 pub ( crate ) failuremsg : Vec < u8 > ,
@@ -2597,6 +2608,22 @@ impl Writeable for OutboundOnionPayload {
25972608 }
25982609}
25992610
2611+ impl Writeable for OutboundTrampolinePayload {
2612+ fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
2613+ match self {
2614+ Self :: Forward { amt_to_forward, outgoing_cltv_value, outgoing_node_id } => {
2615+ _encode_varint_length_prefixed_tlv ! ( w, {
2616+ ( 2 , HighZeroBytesDroppedBigSize ( * amt_to_forward) , required) ,
2617+ ( 4 , HighZeroBytesDroppedBigSize ( * outgoing_cltv_value) , required) ,
2618+ ( 14 , outgoing_node_id, required)
2619+ } ) ;
2620+ }
2621+ }
2622+ Ok ( ( ) )
2623+ }
2624+ }
2625+
2626+
26002627impl < NS : Deref > ReadableArgs < ( Option < PublicKey > , & NS ) > for InboundOnionPayload where NS :: Target : NodeSigner {
26012628 fn read < R : Read > ( r : & mut R , args : ( Option < PublicKey > , & NS ) ) -> Result < Self , DecodeError > {
26022629 let ( update_add_blinding_point, node_signer) = args;
0 commit comments