breez_sdk_liquid::lightning::routing::router

Trait Router

pub trait Router {
    // Required method
    fn find_route(
        &self,
        payer: &PublicKey,
        route_params: &RouteParameters,
        first_hops: Option<&[&ChannelDetails]>,
        inflight_htlcs: InFlightHtlcs,
    ) -> Result<Route, LightningError>;

    // Provided method
    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> { ... }
}
Expand description

A trait defining behavior for routing a payment.

Required Methods§

fn find_route( &self, payer: &PublicKey, route_params: &RouteParameters, first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs, ) -> Result<Route, LightningError>

Finds a Route for a payment between the given payer and a payee.

The payee and the payment’s value are given in RouteParameters::payment_params and RouteParameters::final_value_msat, respectively.

Provided Methods§

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>

Finds a Route for a payment between the given payer and a payee.

The payee and the payment’s value are given in RouteParameters::payment_params and RouteParameters::final_value_msat, respectively.

Includes a PaymentHash and a PaymentId to be able to correlate the request with a specific payment.

Implementors§

§

impl<G, L, S, SP, Sc> Router for DefaultRouter<G, L, S, SP, Sc>
where G: Deref<Target = NetworkGraph<L>>, L: Deref, S: Deref, Sc: ScoreLookUp<ScoreParams = SP>, <L as Deref>::Target: Logger, <S as Deref>::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,