breez_sdk_liquid::lightning_125::routing::scoring

Trait ScoreUpdate

pub trait ScoreUpdate {
    // Required methods
    fn payment_path_failed(
        &mut self,
        path: &Path,
        short_channel_id: u64,
        duration_since_epoch: Duration,
    );
    fn payment_path_successful(
        &mut self,
        path: &Path,
        duration_since_epoch: Duration,
    );
    fn probe_failed(
        &mut self,
        path: &Path,
        short_channel_id: u64,
        duration_since_epoch: Duration,
    );
    fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration);
    fn time_passed(&mut self, duration_since_epoch: Duration);
}
Expand description

ScoreUpdate is used to update the scorer’s internal state after a payment attempt.

Required Methods§

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.

fn payment_path_successful( &mut self, path: &Path, duration_since_epoch: Duration, )

Handles updating channel penalties after successfully routing along a path.

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.

fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)

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

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).

Implementors§

§

impl ScoreUpdate for FixedPenaltyScorer

§

impl<G, L> ScoreUpdate for ProbabilisticScorer<G, L>
where G: Deref<Target = NetworkGraph<L>>, L: Deref, <L as Deref>::Target: Logger,

§

impl<S, T> ScoreUpdate for T
where S: ScoreUpdate, T: DerefMut<Target = S>,