diff --git a/routing/pathfind.go b/routing/pathfind.go index 98874083..7867a41b 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -28,6 +28,28 @@ const ( infinity = math.MaxInt64 ) +// HopHint is a routing hint that contains the minimum information of a channel +// required for an intermediate hop in a route to forward the payment to the +// next. This should be ideally used for private channels, since they are not +// publicly advertised to the network for routing. +type HopHint struct { + // NodeID is the public key of the node at the start of the channel. + NodeID *btcec.PublicKey + + // ChannelID is the unique identifier of the channel. + ChannelID uint64 + + // FeeBaseMSat is the base fee of the channel in millisatoshis. + FeeBaseMSat uint32 + + // FeeProportionalMillionths is the fee rate, in millionths of a + // satoshi, for every satoshi sent through the channel. + FeeProportionalMillionths uint32 + + // CLTVExpiryDelta is the time-lock delta of the channel. + CLTVExpiryDelta uint16 +} + // ChannelHop is an intermediate hop within the network with a greater // multi-hop payment route. This struct contains the relevant routing policy of // the particular edge, as well as the total capacity, and origin chain of the diff --git a/routing/router.go b/routing/router.go index a6fa6085..4515555c 100644 --- a/routing/router.go +++ b/routing/router.go @@ -1482,6 +1482,16 @@ type LightningPayment struct { // indefinitely. PayAttemptTimeout time.Duration + // RouteHints represents the different routing hints that can be used to + // assist a payment in reaching its destination successfully. These + // hints will act as intermediate hops along the route. + // + // NOTE: This is optional unless required by the payment. When providing + // multiple routes, ensure the hop hints within each route are chained + // together and sorted in forward order in order to reach the + // destination successfully. + RouteHints [][]HopHint + // TODO(roasbeef): add e2e message? }