Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lightning/src/routing/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,25 @@ fn sort_first_hop_channels(
/// 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.
///
/// Routes are constructed by searching the provided [`NetworkGraph`] for paths from the payer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads as a second introductory sentence, maybe it should simply replace the first sentence instead?

/// to the payee that satisfy the constraints in [`RouteParameters`]. Fees are accumulated
/// backwards from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"accumulated backwards" doesn't really tell me what this means or why its important if I don't know LN super well. Maybe its worth just leaving out or tweaking, though I'm not quite sure how to do so, maybe something like this?

Suggested change
/// backwards from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop.
/// by totaling fees at each hop from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop.

///
/// Channel selection and path ranking are influenced by the provided [`ScoreLookUp`]
/// implementation, which may apply penalties based on historical reliability,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention how the penalties are included.

/// liquidity hints, or in-flight HTLCs.
///
/// If `first_hops` is provided, those channels are used as the only outbound candidates
/// from the payer, overriding the corresponding entries in the [`NetworkGraph`].
///
/// # Errors
///
/// Returns an error if:
/// - The payer and payee are the same node.
/// - The payment amount is zero or exceeds the maximum representable value.
/// - The total CLTV expiry constraint cannot accommodate the payee's required final CLTV delta.
/// - No route satisfying liquidity, feature, and policy constraints can be found.
///
/// # Panics
///
/// Panics if first_hops contains channels without `short_channel_id`s;
Expand Down