mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 01:36:24 +01:00
routing: don't compute prob for success amounts
We skip the evaluation of probabilities when the amount is lower than the last success amount, as the probability would be evaluated to 1 in that case.
This commit is contained in:
parent
9087f4045b
commit
1878fa1351
1 changed files with 5 additions and 0 deletions
|
@ -525,6 +525,11 @@ func (p *BimodalEstimator) probabilityFormula(capacityMsat, successAmountMsat,
|
|||
return 0.0, nil
|
||||
}
|
||||
|
||||
// We can send the amount if it is smaller than the success amount.
|
||||
if amount <= successAmount {
|
||||
return 1.0, nil
|
||||
}
|
||||
|
||||
// The success probability for payment amount a is the integral over the
|
||||
// prior distribution P(x), the probability to find liquidity between
|
||||
// the amount a and channel capacity c (or failAmount a_f):
|
||||
|
|
Loading…
Add table
Reference in a new issue