pub struct DefaultRouter<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>>where
L::Target: Logger,
S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,
ES::Target: EntropySource,{ /* private fields */ }
Expand description
A Router
implemented using find_route
.
§Privacy
Creating BlindedPaymentPath
s may affect privacy since, if a suitable path cannot be found,
it will create a one-hop path using the recipient as the introduction node if it is a announced
node. Otherwise, there is no way to find a path to the introduction node in order to send a
payment, and thus an Err
is returned.
Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> DefaultRouter<G, L, ES, S, SP, Sc>where
L::Target: Logger,
S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,
ES::Target: EntropySource,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> DefaultRouter<G, L, ES, S, SP, Sc>where
L::Target: Logger,
S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,
ES::Target: EntropySource,
Trait Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> Router for DefaultRouter<G, L, ES, S, SP, Sc>where
L::Target: Logger,
S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,
ES::Target: EntropySource,
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> Router for DefaultRouter<G, L, ES, S, SP, Sc>where
L::Target: Logger,
S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>,
ES::Target: EntropySource,
Source§fn find_route(
&self,
payer: &PublicKey,
params: &RouteParameters,
first_hops: Option<&[&ChannelDetails]>,
inflight_htlcs: InFlightHtlcs,
) -> Result<Route, LightningError>
fn find_route( &self, payer: &PublicKey, params: &RouteParameters, first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs, ) -> Result<Route, LightningError>
Source§fn create_blinded_payment_paths<T: Signing + Verification>(
&self,
recipient: PublicKey,
first_hops: Vec<ChannelDetails>,
tlvs: ReceiveTlvs,
amount_msats: u64,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPaymentPath>, ()>
fn create_blinded_payment_paths<T: Signing + Verification>( &self, recipient: PublicKey, first_hops: Vec<ChannelDetails>, tlvs: ReceiveTlvs, amount_msats: u64, secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedPaymentPath>, ()>
Creates
BlindedPaymentPath
s for payment to the recipient
node. The channels in first_hops
are assumed to be with the recipient
’s peers. The payment secret and any constraints are
given in tlvs
.Source§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>
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>
Auto Trait Implementations§
impl<G, L, ES, S, SP, Sc> Freeze for DefaultRouter<G, L, ES, S, SP, Sc>
impl<G, L, ES, S, SP, Sc> RefUnwindSafe for DefaultRouter<G, L, ES, S, SP, Sc>
impl<G, L, ES, S, SP, Sc> Send for DefaultRouter<G, L, ES, S, SP, Sc>
impl<G, L, ES, S, SP, Sc> Sync for DefaultRouter<G, L, ES, S, SP, Sc>
impl<G, L, ES, S, SP, Sc> Unpin for DefaultRouter<G, L, ES, S, SP, Sc>
impl<G, L, ES, S, SP, Sc> UnwindSafe for DefaultRouter<G, L, ES, S, SP, Sc>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more