Trait lightning::routing::scoring::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§
sourcefn payment_path_failed(
&mut self,
path: &Path,
short_channel_id: u64,
duration_since_epoch: Duration
)
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.
sourcefn payment_path_successful(
&mut self,
path: &Path,
duration_since_epoch: Duration
)
fn payment_path_successful( &mut self, path: &Path, duration_since_epoch: Duration )
Handles updating channel penalties after successfully routing along a path.
sourcefn probe_failed(
&mut self,
path: &Path,
short_channel_id: u64,
duration_since_epoch: Duration
)
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.
sourcefn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)
fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)
Handles updating channel penalties after a probe over the given path succeeded.
sourcefn time_passed(&mut self, duration_since_epoch: Duration)
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: Deref<Target = NetworkGraph<L>>, L: Deref> ScoreUpdate for ProbabilisticScorer<G, L>
impl<S: ScoreUpdate, T: DerefMut<Target = S>> ScoreUpdate for T
Available on non-
c_bindings
only.