mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-19 18:48:03 +01:00
routing: rename and export routingGraph
In preparation for structs outside of the `routing` package implementing this interface, export `routingGraph` and rename it to `Graph` so as to avoid stuttering.
This commit is contained in:
@@ -164,8 +164,8 @@ func (m *mockGraph) addChannel(id uint64, node1id, node2id byte,
|
||||
|
||||
// forEachNodeChannel calls the callback for every channel of the given node.
|
||||
//
|
||||
// NOTE: Part of the routingGraph interface.
|
||||
func (m *mockGraph) forEachNodeChannel(nodePub route.Vertex,
|
||||
// NOTE: Part of the Graph interface.
|
||||
func (m *mockGraph) ForEachNodeChannel(nodePub route.Vertex,
|
||||
cb func(channel *channeldb.DirectedChannel) error) error {
|
||||
|
||||
// Look up the mock node.
|
||||
@@ -213,15 +213,15 @@ func (m *mockGraph) forEachNodeChannel(nodePub route.Vertex,
|
||||
|
||||
// sourceNode returns the source node of the graph.
|
||||
//
|
||||
// NOTE: Part of the routingGraph interface.
|
||||
// NOTE: Part of the Graph interface.
|
||||
func (m *mockGraph) sourceNode() route.Vertex {
|
||||
return m.source.pubkey
|
||||
}
|
||||
|
||||
// fetchNodeFeatures returns the features of the given node.
|
||||
//
|
||||
// NOTE: Part of the routingGraph interface.
|
||||
func (m *mockGraph) fetchNodeFeatures(nodePub route.Vertex) (
|
||||
// NOTE: Part of the Graph interface.
|
||||
func (m *mockGraph) FetchNodeFeatures(nodePub route.Vertex) (
|
||||
*lnwire.FeatureVector, error) {
|
||||
|
||||
return lnwire.EmptyFeatureVector(), nil
|
||||
@@ -230,7 +230,7 @@ func (m *mockGraph) fetchNodeFeatures(nodePub route.Vertex) (
|
||||
// FetchAmountPairCapacity returns the maximal capacity between nodes in the
|
||||
// graph.
|
||||
//
|
||||
// NOTE: Part of the routingGraph interface.
|
||||
// NOTE: Part of the Graph interface.
|
||||
func (m *mockGraph) FetchAmountPairCapacity(nodeFrom, nodeTo route.Vertex,
|
||||
amount lnwire.MilliSatoshi) (btcutil.Amount, error) {
|
||||
|
||||
@@ -244,7 +244,7 @@ func (m *mockGraph) FetchAmountPairCapacity(nodeFrom, nodeTo route.Vertex,
|
||||
return nil
|
||||
}
|
||||
|
||||
err := m.forEachNodeChannel(nodeFrom, cb)
|
||||
err := m.ForEachNodeChannel(nodeFrom, cb)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -295,5 +295,5 @@ func (m *mockGraph) sendHtlc(route *route.Route) (htlcResult, error) {
|
||||
return source.fwd(nil, next)
|
||||
}
|
||||
|
||||
// Compile-time check for the routingGraph interface.
|
||||
var _ routingGraph = &mockGraph{}
|
||||
// Compile-time check for the Graph interface.
|
||||
var _ Graph = &mockGraph{}
|
||||
|
||||
Reference in New Issue
Block a user