@@ -298,7 +298,6 @@ pub struct ForwardTlvs {
298298}
299299
300300/// Data to construct a [`BlindedHop`] for forwarding a Trampoline payment.
301- #[ cfg( trampoline) ]
302301#[ derive( Clone , Debug ) ]
303302pub struct TrampolineForwardTlvs {
304303 /// The node id to which the trampoline node must find a route.
@@ -371,7 +370,6 @@ pub(crate) enum BlindedPaymentTlvs {
371370/// Data to construct a [`BlindedHop`] for sending a Trampoline payment over.
372371///
373372/// [`BlindedHop`]: crate::blinded_path::BlindedHop
374- #[ cfg( trampoline) ]
375373pub ( crate ) enum BlindedTrampolineTlvs {
376374 /// This blinded payment data is for a forwarding node.
377375 Forward ( TrampolineForwardTlvs ) ,
@@ -514,6 +512,23 @@ impl Writeable for ForwardTlvs {
514512 }
515513}
516514
515+ impl Writeable for TrampolineForwardTlvs {
516+ fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
517+ let features_opt = if self . features == BlindedHopFeatures :: empty ( ) {
518+ None
519+ } else {
520+ Some ( WithoutLength ( & self . features ) )
521+ } ;
522+ encode_tlv_stream ! ( w, {
523+ ( 4 , self . next_trampoline, required) ,
524+ ( 10 , self . payment_relay, required) ,
525+ ( 12 , self . payment_constraints, required) ,
526+ ( 14 , features_opt, option)
527+ } ) ;
528+ Ok ( ( ) )
529+ }
530+ }
531+
517532impl Writeable for ReceiveTlvs {
518533 fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , io:: Error > {
519534 encode_tlv_stream ! ( w, {
@@ -591,14 +606,13 @@ impl Readable for BlindedPaymentTlvs {
591606 }
592607}
593608
594- #[ cfg( trampoline) ]
595609impl Readable for BlindedTrampolineTlvs {
596610 fn read < R : io:: Read > ( r : & mut R ) -> Result < Self , DecodeError > {
597611 _init_and_read_tlv_stream ! ( r, {
612+ ( 4 , next_trampoline, option) ,
598613 ( 8 , next_blinding_override, option) ,
599614 ( 10 , payment_relay, option) ,
600615 ( 12 , payment_constraints, required) ,
601- ( 14 , next_trampoline, option) ,
602616 ( 14 , features, ( option, encoding: ( BlindedHopFeatures , WithoutLength ) ) ) ,
603617 ( 65536 , payment_secret, option) ,
604618 ( 65537 , payment_context, option) ,
0 commit comments