Split out success probability calculation to allow for changes
authorMatt Corallo <git@bluematt.me>
Mon, 24 Apr 2023 05:16:51 +0000 (05:16 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 19 Sep 2023 21:22:49 +0000 (21:22 +0000)
commit75438900b271e09a54c6e97ca9339ac0e36c055f
tree68b6c647f5ede1e7762ad7e1231300cb9df98ce7
parent6d5c5ba4bbfd0419a284bab8d2d52cef42afbbf1
Split out success probability calculation to allow for changes

Our "what is the success probability of paying over a channel with
the given liquidity bounds" calculation is reused in a few places,
and is a key assumption across our main score calculation and the
historical bucket score calculations.

Here we break it out into a function to make it easier to
experiment with different success probability calculations.

Note that this drops the numerator +1 in the liquidity scorer,
which was added to compensate for the divisor + 1 (which exists to
avoid divide-by-zero), making the new math slightly less correct
but not by any material amount.
lightning/src/routing/scoring.rs