routing: use capacity in pathfinding
Extends the pathfinder with a capacity argument for later usage. In tests, the inserted testCapacity has no effect, but will be used later to estimate reduced probabilities from it.
This commit is contained in:
11 files changed
+70
-37
No files matched your search
@@ -5,6 +5,7 @@ import (
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
)
|
||||
@@ -150,8 +151,8 @@ func (p *probabilityEstimator) getWeight(age time.Duration) float64 {
|
||||
// toNode based on historical payment outcomes for the from node. Those outcomes
|
||||
// are passed in via the results parameter.
|
||||
func (p *probabilityEstimator) getPairProbability(
|
||||
now time.Time, results NodeResults,
|
||||
toNode route.Vertex, amt lnwire.MilliSatoshi) float64 {
|
||||
now time.Time, results NodeResults, toNode route.Vertex,
|
||||
amt lnwire.MilliSatoshi, capacity btcutil.Amount) float64 {
|
||||
|
||||
nodeProbability := p.getNodeProbability(now, results, amt)
|
||||
|
||||
|
||||
Reference in new issue
Block a user