File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -602,6 +602,8 @@ func (c *ChannelGraph) FetchNodeFeaturesTx(tx kvdb.RTx,
602
602
// of the database.
603
603
//
604
604
// Unknown policies are passed into the callback as nil values.
605
+ //
606
+ // NOTE: this is part of the graphdb.NodeTraverser interface.
605
607
func (c * ChannelGraph ) ForEachNodeDirectedChannel (nodePub route.Vertex ,
606
608
cb func (channel * DirectedChannel ) error ) error {
607
609
@@ -612,6 +614,8 @@ func (c *ChannelGraph) ForEachNodeDirectedChannel(nodePub route.Vertex,
612
614
// known for the node, an empty feature vector is returned.
613
615
// If the graphCache is available, then it will be used to retrieve the node's
614
616
// features instead of the database.
617
+ //
618
+ // NOTE: this is part of the graphdb.NodeTraverser interface.
615
619
func (c * ChannelGraph ) FetchNodeFeatures (nodePub route.Vertex ) (
616
620
* lnwire.FeatureVector , error ) {
617
621
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package graphdb
2
2
3
3
import (
4
4
"github.com/lightningnetwork/lnd/graph/db/models"
5
+ "github.com/lightningnetwork/lnd/lnwire"
5
6
"github.com/lightningnetwork/lnd/routing/route"
6
7
)
7
8
@@ -23,3 +24,16 @@ type NodeRTx interface {
23
24
// the same transaction.
24
25
FetchNode (node route.Vertex ) (NodeRTx , error )
25
26
}
27
+
28
+ // NodeTraverser is an abstract read only interface that provides information
29
+ // about nodes and their edges. The interface is about providing fast read-only
30
+ // access to the graph and so if a cache is available, it should be used.
31
+ type NodeTraverser interface {
32
+ // ForEachNodeDirectedChannel calls the callback for every channel of
33
+ // the given node.
34
+ ForEachNodeDirectedChannel (nodePub route.Vertex ,
35
+ cb func (channel * DirectedChannel ) error ) error
36
+
37
+ // FetchNodeFeatures returns the features of the given node.
38
+ FetchNodeFeatures (nodePub route.Vertex ) (* lnwire.FeatureVector , error )
39
+ }
You can’t perform that action at this time.
0 commit comments