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:
bitromortac committed 2022-12-12 13:22:28 +01:00
1 parent 2b6308a61f
commit 516e3a8cca
11 files changed
+70 -37

No files matched your search

+4 -3
View File
@@ -5,6 +5,7 @@ import (
"sync"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/htlcswitch"
@@ -139,7 +140,7 @@ func (m *mockMissionControlOld) ReportPaymentSuccess(paymentID uint64,
}
func (m *mockMissionControlOld) GetProbability(fromNode, toNode route.Vertex,
amt lnwire.MilliSatoshi) float64 {
amt lnwire.MilliSatoshi, capacity btcutil.Amount) float64 {
return 0
}
@@ -650,9 +651,9 @@ func (m *mockMissionControl) ReportPaymentSuccess(paymentID uint64,
}
func (m *mockMissionControl) GetProbability(fromNode, toNode route.Vertex,
amt lnwire.MilliSatoshi) float64 {
amt lnwire.MilliSatoshi, capacity btcutil.Amount) float64 {
args := m.Called(fromNode, toNode, amt)
args := m.Called(fromNode, toNode, amt, capacity)
return args.Get(0).(float64)
}