Module router
Expand description
The router finds paths within a NetworkGraph
for a payment.
Structs§
- Blinded
Tail - The blinded portion of a
Path
, if we’re routing to a recipient who provided blinded paths in theirBolt12Invoice
. - Default
Router - A
Router
implemented usingfind_route
. - InFlight
Htlcs - A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for in-use channel liquidity.
- Path
- A path in a
Route
to the payment recipient. Must always be at least length one. If noPath::blinded_tail
is present, thenPath::hops
length may be up to 19. - Payment
Parameters - Information used to route a payment.
- Route
- A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, it can take multiple paths. Each path is composed of one or more hops through the network.
- Route
Hint - A list of hops along a payment path terminating with a channel to the recipient.
- Route
Hint Hop - A channel descriptor for a hop along a payment path.
- Route
Hop - A hop in a route, and additional metadata about it. “Hop” is defined as a node and the channel that leads to it.
- Route
Parameters - Parameters needed to find a
Route
. - Scorer
Accounting ForIn Flight Htlcs ScoreLookUp
implementation that factors in in-flight HTLC liquidity.
Enums§
- Payee
- The recipient of a payment, differing based on whether they’ve hidden their identity with route blinding.
Constants§
- DEFAULT_
MAX_ PATH_ COUNT - Maximum number of paths we allow an (MPP) payment to have.
- DEFAULT_
MAX_ TOTAL_ CLTV_ EXPIRY_ DELTA - Maximum total CTLV difference we allow for a full payment path.
Traits§
- Router
- A trait defining behavior for routing a payment.
Functions§
- build_
route_ from_ hops - Construct a route from us (payer) to the target node (payee) via the given hops (which should exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
- find_
route - Finds a route from us (payer) to the given target node (payee).