mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-19 05:11:25 +02:00
routing/router: extend ChannelGraphSource interface with IsPublicNode
method
This commit is contained in:
parent
e795f7fce4
commit
18ecb31983
@ -72,6 +72,10 @@ type ChannelGraphSource interface {
|
|||||||
// the target node.
|
// the target node.
|
||||||
IsStaleNode(node Vertex, timestamp time.Time) bool
|
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
|
// IsKnownEdge returns true if the graph source already knows of the
|
||||||
// passed channel ID.
|
// passed channel ID.
|
||||||
IsKnownEdge(chanID lnwire.ShortChannelID) bool
|
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
|
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
|
// IsKnownEdge returns true if the graph source already knows of the passed
|
||||||
// channel ID.
|
// channel ID.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user