pub struct RandomizedEdgeWeighting;
Expand description
Assigns each channel a weight. The weight is randomized such that the same nodes get not always selected. This is necessary to achieve privacy. It also favors nodes with higher stake.
Trait Implementations§
Source§impl Clone for RandomizedEdgeWeighting
impl Clone for RandomizedEdgeWeighting
Source§fn clone(&self) -> RandomizedEdgeWeighting
fn clone(&self) -> RandomizedEdgeWeighting
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RandomizedEdgeWeighting
impl Debug for RandomizedEdgeWeighting
Source§impl Default for RandomizedEdgeWeighting
impl Default for RandomizedEdgeWeighting
Source§fn default() -> RandomizedEdgeWeighting
fn default() -> RandomizedEdgeWeighting
Returns the “default value” for a type. Read more
Source§impl EdgeWeighting<U256> for RandomizedEdgeWeighting
impl EdgeWeighting<U256> for RandomizedEdgeWeighting
Source§fn calculate_weight(edge: &ChannelEdge) -> U256
fn calculate_weight(edge: &ChannelEdge) -> U256
Multiply channel stake with a random float in the interval [0,1). Given that the floats are uniformly distributed, nodes with higher stake have a higher probability of reaching a higher value.
Sorting the list of weights thus moves nodes with higher stakes more often to the front.
impl Copy for RandomizedEdgeWeighting
Auto Trait Implementations§
impl Freeze for RandomizedEdgeWeighting
impl RefUnwindSafe for RandomizedEdgeWeighting
impl Send for RandomizedEdgeWeighting
impl Sync for RandomizedEdgeWeighting
impl Unpin for RandomizedEdgeWeighting
impl UnwindSafe for RandomizedEdgeWeighting
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more