routing/router: extend ChannelGraphSource interface with IsPublicNode

method
This commit is contained in:
Wilmer Paulino 2018-10-17 15:47:12 -07:00
parent e795f7fce4
commit 18ecb31983
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -72,6 +72,10 @@ type ChannelGraphSource interface {
// the target node.
IsStaleNode(node Vertex, timestamp time.Time) bool
// IsPublicNode determines whether the given vertex is seen as a public
// node in the graph from the graph's source node's point of view.
IsPublicNode(node Vertex) (bool, error)
// IsKnownEdge returns true if the graph source already knows of the
// passed channel ID.
IsKnownEdge(chanID lnwire.ShortChannelID) bool
@ -2222,6 +2226,14 @@ func (r *ChannelRouter) IsStaleNode(node Vertex, timestamp time.Time) bool {
return r.assertNodeAnnFreshness(node, timestamp) != nil
}
// IsPublicNode determines whether the given vertex is seen as a public node in
// the graph from the graph's source node's point of view.
//
// NOTE: This method is part of the ChannelGraphSource interface.
func (r *ChannelRouter) IsPublicNode(node Vertex) (bool, error) {
return r.cfg.Graph.IsPublicNode(node)
}
// IsKnownEdge returns true if the graph source already knows of the passed
// channel ID.
//