Function lightning::routing::router::get_route [−][src]
pub fn get_route<L: Deref>(
our_node_id: &PublicKey,
network: &NetworkGraph,
payee: &PublicKey,
payee_features: Option<InvoiceFeatures>,
first_hops: Option<&[&ChannelDetails]>,
last_hops: &[&RouteHint],
final_value_msat: u64,
final_cltv: u32,
logger: L
) -> Result<Route, LightningError> where
L::Target: Logger,
Expand description
Gets a route from us (payer) to the given target node (payee).
If the payee provided features in their invoice, they should be provided via payee_features. Without this, MPP will only be used if the payee’s features are available in the network graph.
Private routing paths between a public node and the target may be included in last_hops
.
Currently, only the last hop in each path is considered.
If some channels aren’t announced, it may be useful to fill in a first_hops with the results from a local ChannelManager::list_usable_channels() call. If it is filled in, our view of our local channels (from net_graph_msg_handler) will be ignored, and only those in first_hops will be used.
Panics if first_hops contains channels without short_channel_ids (ChannelManager::list_usable_channels will never include such channels).
The fees on channels from us to next-hops are ignored (as they are assumed to all be equal), however the enabled/disabled bit on such channels as well as the htlc_minimum_msat/htlc_maximum_msat are checked as they may change based on the receiving node.