Trait lightning_invoice::payment::Router
source · [−]pub trait Router {
fn find_route(
&self,
payer: &PublicKey,
route_params: &RouteParameters,
payment_hash: &PaymentHash,
first_hops: Option<&[&ChannelDetails]>,
inflight_htlcs: InFlightHtlcs
) -> Result<Route, LightningError>;
fn notify_payment_path_failed(
&self,
path: &[&RouteHop],
short_channel_id: u64
);
fn notify_payment_path_successful(&self, path: &[&RouteHop]);
fn notify_payment_probe_successful(&self, path: &[&RouteHop]);
fn notify_payment_probe_failed(
&self,
path: &[&RouteHop],
short_channel_id: u64
);
}
Expand description
A trait defining behavior for routing an Invoice
payment.
Required Methods
sourcefn find_route(
&self,
payer: &PublicKey,
route_params: &RouteParameters,
payment_hash: &PaymentHash,
first_hops: Option<&[&ChannelDetails]>,
inflight_htlcs: InFlightHtlcs
) -> Result<Route, LightningError>
fn find_route(
&self,
payer: &PublicKey,
route_params: &RouteParameters,
payment_hash: &PaymentHash,
first_hops: Option<&[&ChannelDetails]>,
inflight_htlcs: InFlightHtlcs
) -> Result<Route, LightningError>
Finds a Route
between payer
and payee
for a payment with the given values.
sourcefn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64)
fn notify_payment_path_failed(&self, path: &[&RouteHop], short_channel_id: u64)
Lets the router know that payment through a specific path has failed.
sourcefn notify_payment_path_successful(&self, path: &[&RouteHop])
fn notify_payment_path_successful(&self, path: &[&RouteHop])
Lets the router know that payment through a specific path was successful.
sourcefn notify_payment_probe_successful(&self, path: &[&RouteHop])
fn notify_payment_probe_successful(&self, path: &[&RouteHop])
Lets the router know that a payment probe was successful.
sourcefn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64)
fn notify_payment_probe_failed(&self, path: &[&RouteHop], short_channel_id: u64)
Lets the router know that a payment probe failed.