routing+refactor: remove the need to give CachedGraph source node access

In preparation for the next commit.
This commit is contained in:
Elle Mouton committed 2024-07-15 13:10:24 +02:00
1 parent 3f121cbe81
commit 90d6b863a8
6 files changed
+15 -46

No files matched your search

-25
View File
@@ -227,31 +227,6 @@ func (m *mockGraph) FetchNodeFeatures(nodePub route.Vertex) (
return lnwire.EmptyFeatureVector(), nil
}
// FetchAmountPairCapacity returns the maximal capacity between nodes in the
// graph.
//
// NOTE: Part of the Graph interface.
func (m *mockGraph) FetchAmountPairCapacity(nodeFrom, nodeTo route.Vertex,
amount lnwire.MilliSatoshi) (btcutil.Amount, error) {
var capacity btcutil.Amount
cb := func(channel *channeldb.DirectedChannel) error {
if channel.OtherNode == nodeTo {
capacity = channel.Capacity
}
return nil
}
err := m.ForEachNodeChannel(nodeFrom, cb)
if err != nil {
return 0, err
}
return capacity, nil
}
// htlcResult describes the resolution of an htlc. If failure is nil, the htlc
// was settled.
type htlcResult struct {