Struct lightning::routing::scoring::FixedPenaltyScorer

source ·
pub struct FixedPenaltyScorer { /* private fields */ }
Expand description

ScoreLookUp implementation that uses a fixed penalty.

Implementations§

source§

impl FixedPenaltyScorer

source

pub fn with_penalty(penalty_msat: u64) -> Self

Creates a new scorer using penalty_msat.

Trait Implementations§

source§

impl Clone for FixedPenaltyScorer

source§

fn clone(&self) -> FixedPenaltyScorer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ReadableArgs<u64> for FixedPenaltyScorer

source§

fn read<R: Read>(r: &mut R, penalty_msat: u64) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
source§

impl ScoreLookUp for FixedPenaltyScorer

§

type ScoreParams = ()

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
source§

fn channel_penalty_msat( &self, _: &CandidateRouteHop<'_>, _: ChannelUsage, _score_params: &Self::ScoreParams ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
source§

impl ScoreUpdate for FixedPenaltyScorer

source§

fn payment_path_failed( &mut self, _path: &Path, _short_channel_id: u64, _duration_since_epoch: Duration )

Handles updating channel penalties after failing to route through a channel.
source§

fn payment_path_successful( &mut self, _path: &Path, _duration_since_epoch: Duration )

Handles updating channel penalties after successfully routing along a path.
source§

fn probe_failed( &mut self, _path: &Path, _short_channel_id: u64, _duration_since_epoch: Duration )

Handles updating channel penalties after a probe over the given path failed.
source§

fn probe_successful(&mut self, _path: &Path, _duration_since_epoch: Duration)

Handles updating channel penalties after a probe over the given path succeeded.
source§

fn time_passed(&mut self, _duration_since_epoch: Duration)

Scorers may wish to reduce their certainty of channel liquidity information over time. Thus, this method is provided to allow scorers to observe the passage of time - the holder of this object should call this method regularly (generally via the lightning-background-processor crate).
source§

impl Writeable for FixedPenaltyScorer

source§

fn write<W: Writer>(&self, w: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
source§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Score for T