Trait ScoreUpdate

Source
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§

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

Implementors§