Skip to content

Commit 8ca062f

Browse files
f add payment hash and id methods to new ScoringRouter method
1 parent 52f494d commit 8ca062f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lightning-invoice/src/payment.rs

+10
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ pub trait Payer {
270270
///
271271
/// [`Router`]: lightning::routing::router::Router
272272
pub trait ScoringRouter: Router {
273+
/// Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
274+
/// `PaymentHash` and `PaymentId` in case the underlying implementation wants to look up a
275+
/// precomputed route for probing.
276+
fn find_route_with_id(
277+
&self, payer: &PublicKey, route_params: &RouteParameters,
278+
first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs,
279+
_payment_hash: PaymentHash, _payment_id: PaymentId
280+
) -> Result<Route, LightningError> {
281+
self.find_route(payer, route_params, first_hops, inflight_htlcs)
282+
}
273283
/// Lets the router know that payment through a specific path has failed.
274284
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
275285
/// Lets the router know that payment through a specific path was successful.

0 commit comments

Comments
 (0)