Add Node::find_route accessor#29
Merged
amackillop merged 1 commit intoMay 14, 2026
Merged
Conversation
Public wrapper around the previously private `_router` so callers can resolve a route to a destination without dispatching a payment. The intended consumer is mdk's max-withdrawable estimator, which needs a real route to invert per-hop fees against payout destinations. The signature takes `Option<RouteParametersConfig>`. With `None` the node-wide `Config::route_parameters` applies, matching the fallback already used by `SpontaneousPayment::send_inner`. Keeps both call sites consistent. `Error::RouteNotFound` is a new variant. This path performs lookup only and never dispatches anything, and a missing route under current liquidity is a routine outcome. The router's `&'static str` reason is logged at debug level and dropped; callers already get the typed error. `Route` and `RouteParametersConfig` are re-exported from `lib.rs` for Rust consumers. No UDL bindings in this commit: the `uniffi` build is currently broken on this branch from drift left over by the rust-lightning upgrade in e935695, so adding more UDL surface would fly blind. A follow-up that fixes the existing drift can layer `Route` bindings on top. The returned `Route` may contain multiple `Path` entries when `max_path_count > 1`, since the router is free to split the amount across MPP paths. Callers wanting a single-path response should set `max_path_count: 1` in the supplied config.
23c0ff0
into
lsp-0.7.0_accept-underpaying-htlcs_with_timing_logs
6 of 34 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Public wrapper around the previously private
_routerso callers can resolve a route to a destination without dispatching a payment. The intended consumer is mdk's max-withdrawable estimator, which needs a real route to invert per-hop fees against payout destinations.The signature takes
Option<RouteParametersConfig>. WithNonethe node-wideConfig::route_parametersapplies, matching the fallback already used bySpontaneousPayment::send_inner. Keeps both call sites consistent.Error::RouteNotFoundis a new variant. This path performs lookup only and never dispatches anything, and a missing route under current liquidity is a routine outcome. The router's&'static strreason is logged at debug level and dropped; callers already get the typed error.RouteandRouteParametersConfigare re-exported fromlib.rsfor Rust consumers. No UDL bindings in this commit: theuniffibuild is currently broken on this branch from drift left over by the rust-lightning upgrade in e935695, so adding more UDL surface would fly blind. A follow-up that fixes the existing drift can layerRoutebindings on top.The returned
Routemay contain multiplePathentries whenmax_path_count > 1, since the router is free to split the amount across MPP paths. Callers wanting a single-path response should setmax_path_count: 1in the supplied config.