mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 21:53:12 +02:00
routing+refactor: remove the need to give CachedGraph source node access
In preparation for the next commit.
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user