pub struct CombinedScorer<G: Deref<Target = NetworkGraph<L>>, L: Deref>{ /* private fields */ }Expand description
A probabilistic scorer that combines local and external information to score channels. This scorer is shadow-tracking local only scores, so that it becomes possible to cleanly merge external scores when they become available.
This is useful for nodes that have a limited local view of the network and need to augment their view with scores from an external source to improve payment reliability. The external source may use something like background probing to gather a more complete view of the network. Merging reduces the likelihood of losing unique local data on particular channels.
Note that only the locally acquired data is persisted. After a restart, the external scores will be lost and must be resupplied.
Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref + Clone> CombinedScorer<G, L>
impl<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref + Clone> CombinedScorer<G, L>
Sourcepub fn new(local_scorer: ProbabilisticScorer<G, L>) -> Self
pub fn new(local_scorer: ProbabilisticScorer<G, L>) -> Self
Create a new combined scorer with the given local scorer.
Sourcepub fn merge(
&mut self,
external_scores: ChannelLiquidities,
duration_since_epoch: Duration,
)
pub fn merge( &mut self, external_scores: ChannelLiquidities, duration_since_epoch: Duration, )
Merge external channel liquidity information into the scorer.
Sourcepub fn set_scores(&mut self, external_scores: ChannelLiquidities)
pub fn set_scores(&mut self, external_scores: ChannelLiquidities)
Overwrite the scorer state with the given external scores.
Trait Implementations§
Source§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref> ScoreLookUp for CombinedScorer<G, L>
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref> ScoreLookUp for CombinedScorer<G, L>
Source§type ScoreParams = ProbabilisticScoringFeeParameters
type ScoreParams = ProbabilisticScoringFeeParameters
Source§fn channel_penalty_msat(
&self,
candidate: &CandidateRouteHop<'_>,
usage: ChannelUsage,
score_params: &ProbabilisticScoringFeeParameters,
) -> u64
fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &ProbabilisticScoringFeeParameters, ) -> u64
send_amt_msat through the
given channel in the direction from source to target. Read moreSource§impl<G: Deref<Target = NetworkGraph<L>>, L: Deref> ScoreUpdate for CombinedScorer<G, L>
impl<G: Deref<Target = NetworkGraph<L>>, L: Deref> ScoreUpdate for CombinedScorer<G, L>
Source§fn 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, )
Source§fn payment_path_successful(
&mut self,
path: &Path,
duration_since_epoch: Duration,
)
fn payment_path_successful( &mut self, path: &Path, duration_since_epoch: Duration, )
Source§fn 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, )
Source§fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)
fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)
Source§fn time_passed(&mut self, duration_since_epoch: Duration)
fn time_passed(&mut self, duration_since_epoch: Duration)
lightning-background-processor crate).