Module router

Expand description

The router finds paths within a NetworkGraph for a payment.

Structs§

BlindedTail
The blinded portion of a Path, if we’re routing to a recipient who provided blinded paths in their Bolt12Invoice.
DefaultRouter
A Router implemented using find_route.
InFlightHtlcs
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 no Path::blinded_tail is present, then Path::hops length may be up to 19.
PaymentParameters
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.
RouteHint
A list of hops along a payment path terminating with a channel to the recipient.
RouteHintHop
A channel descriptor for a hop along a payment path.
RouteHop
A hop in a route, and additional metadata about it. “Hop” is defined as a node and the channel that leads to it.
RouteParameters
Parameters needed to find a Route.
ScorerAccountingForInFlightHtlcs
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).