@@ -389,6 +389,41 @@ impl_writeable_tlv_based!(RouteHop, {
389
389
( 10 , cltv_expiry_delta, required) ,
390
390
} ) ;
391
391
392
+ /// A Trampoline hop in a route, and additional metadata about it. "Hop" is defined as a node.
393
+ #[ derive( Clone , Debug , Hash , PartialEq , Eq ) ]
394
+ pub struct TrampolineHop {
395
+ /// The node_id of the node at this hop.
396
+ pub pubkey : PublicKey ,
397
+ /// The node_announcement features of the node at this hop. For the last hop, these may be
398
+ /// amended to match the features present in the invoice this node generated.
399
+ pub node_features : NodeFeatures ,
400
+ /// The channel_announcement features of the channel that should be used from the previous hop
401
+ /// to reach this node.
402
+ pub channel_features : ChannelFeatures ,
403
+ /// The fee taken on this hop (for paying for the use of the *next* channel in the path).
404
+ /// If this is the last hop in [`Path::hops`]:
405
+ /// * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
406
+ /// * otherwise, this is the full value of this [`Path`]'s part of the payment
407
+ ///
408
+ /// [`BlindedPath`]: crate::blinded_path::BlindedPath
409
+ pub fee_msat : u64 ,
410
+ /// The CLTV delta added for this hop.
411
+ /// If this is the last hop in [`Path::hops`]:
412
+ /// * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
413
+ /// * otherwise, this is the CLTV delta expected at the destination
414
+ ///
415
+ /// [`BlindedPath`]: crate::blinded_path::BlindedPath
416
+ pub cltv_expiry_delta : u32 ,
417
+ }
418
+
419
+ impl_writeable_tlv_based ! ( TrampolineHop , {
420
+ ( 0 , pubkey, required) ,
421
+ ( 2 , node_features, required) ,
422
+ ( 6 , channel_features, required) ,
423
+ ( 8 , fee_msat, required) ,
424
+ ( 10 , cltv_expiry_delta, required) ,
425
+ } ) ;
426
+
392
427
/// The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
393
428
/// their [`Bolt12Invoice`].
394
429
///
0 commit comments