Module breez_sdk_core::lightning::routing::scoring

Expand description

Utilities for scoring payment channels.

ProbabilisticScorer may be given to find_route to score payment channels during path finding when a custom ScoreLookUp implementation is not needed.

§Example

// Use the default channel penalties.
let params = ProbabilisticScoringFeeParameters::default();
let decay_params = ProbabilisticScoringDecayParameters::default();
let scorer = ProbabilisticScorer::new(decay_params, &network_graph, &logger);

// Or use custom channel penalties.
let params = ProbabilisticScoringFeeParameters {
	liquidity_penalty_multiplier_msat: 2 * 1000,
	..ProbabilisticScoringFeeParameters::default()
};
let decay_params = ProbabilisticScoringDecayParameters::default();
let scorer = ProbabilisticScorer::new(decay_params, &network_graph, &logger);

let route = find_route(&payer, &route_params, &network_graph, None, &logger, &scorer, &params, &random_seed_bytes);

§Note

Persisting when built with feature no-std and restoring without it, or vice versa, uses different types and thus is undefined.

Structs§

Traits§

  • A scorer that is accessed under a lock.
  • A trait which can both lookup and update routing channel penalty scores.
  • An interface used to score payment channels for path finding.
  • ScoreUpdate is used to update the scorer’s internal state after a payment attempt.
  • Refers to a scorer that is accessible under lock and also writeable to disk

Type Aliases§