mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02: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:
@@ -525,6 +525,11 @@ func (p *BimodalEstimator) probabilityFormula(capacityMsat, successAmountMsat,
|
|||||||
return 0.0, nil
|
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
|
// The success probability for payment amount a is the integral over the
|
||||||
// prior distribution P(x), the probability to find liquidity between
|
// prior distribution P(x), the probability to find liquidity between
|
||||||
// the amount a and channel capacity c (or failAmount a_f):
|
// the amount a and channel capacity c (or failAmount a_f):
|
||||||
|
Reference in New Issue
Block a user