Skip to content

Commit 5bfec06

Browse files
committed
f clearer comment, maybe
1 parent cdde853 commit 5bfec06

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lightning/src/routing/scoring.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,11 +1751,13 @@ mod bucketed_history {
17511751
pub(super) fn calculate_success_probability_times_billion<T: Time>(
17521752
&self, now: T, last_updated: T, half_life: Duration, amount_msat: u64, capacity_msat: u64)
17531753
-> Option<u64> {
1754-
// If historical penalties are enabled, calculate the penalty by walking the set of
1755-
// historical liquidity bucket (min, max) combinations (where min_idx < max_idx, as
1756-
// having a minimum above our maximum is an invalid state). For each combination,
1757-
// calculate the probability of success given our payment amount, then total the
1758-
// weighted average probability of success.
1754+
// If historical penalties are enabled, we try to calculate a probability of success
1755+
// given our historical distribution of min- and max-liquidity bounds in a channel.
1756+
// To do so, we walk the set of historical liquidity bucket (min, max) combinations
1757+
// (where min_idx < max_idx, as having a minimum above our maximum is an invalid
1758+
// state). For each pair, we calculate the probability as if the bucket's corresponding
1759+
// min- and max- liquidity bounds were our current liquidity bounds and then multiply
1760+
// that probability by the weight of the selected buckets.
17591761
let mut total_valid_points_tracked = 0;
17601762

17611763
let payment_pos = amount_to_pos(amount_msat, capacity_msat);

0 commit comments

Comments
 (0)