-/// A trait defining behavior for a [`Router`] implementation that also supports scoring channels
-/// based on payment and probe success/failure.
-///
-/// [`Router`]: lightning::routing::router::Router
-pub trait ScoringRouter: Router {
- /// Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
- /// `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment.
- fn find_route_with_id(
- &self, payer: &PublicKey, route_params: &RouteParameters,
- first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs,
- _payment_hash: PaymentHash, _payment_id: PaymentId
- ) -> Result<Route, LightningError> {
- self.find_route(payer, route_params, first_hops, inflight_htlcs)
- }
- /// Lets the router know that payment through a specific path has failed.
- fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64);
- /// Lets the router know that payment through a specific path was successful.
- fn notify_payment_path_successful(&self, path: &[&RouteHop]);
- /// Lets the router know that a payment probe was successful.
- fn notify_payment_probe_successful(&self, path: &[&RouteHop]);
- /// Lets the router know that a payment probe failed.
- fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64);
-}
-