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

In preparation for the next commit.
This commit is contained in:
Elle Mouton
2024-06-25 19:27:13 -07:00
parent 3f121cbe81
commit 90d6b863a8
6 changed files with 15 additions and 46 deletions

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 {