routerrpc: add HasNode backend function for LSP heuristic

This commit adds the HasNode function to the RouterBackend struct,
which checks if a node exists in the graph (i.e., has public channels).
This function is needed by the LSP detection heuristic to determine
if a node is publicly reachable.

The function is wired up in rpcserver.go to query the graph database.
This commit is contained in:
ziggie committed 2025-11-29 01:04:28 +01:00
1 parent 06886e71b2
commit 48da56b285
2 files changed
+12

No files matched your search

+5
View File
@@ -64,6 +64,11 @@ type RouterBackend struct {
FetchChannelEndpoints func(chanID uint64) (route.Vertex,
route.Vertex, error)
// HasNode returns true if the node exists in the graph (i.e., has
// public channels), false otherwise. This means the node is a public
// node and should be reachable.
HasNode func(nodePub route.Vertex) (bool, error)
// FindRoute is a closure that abstracts away how we locate/query for
// routes.
FindRoute func(*routing.RouteRequest) (*route.Route, float64, error)