graph/db: version ForEachNodeDirectedChannel and cacheable traversal
Add a gossip version parameter to ForEachNodeDirectedChannel on the Store interface and both DB implementations (KVStore, SQLStore). The NodeTraverser and routing.Graph interfaces remain unversioned since pathfinding operates on the merged cross-version cache view. The cache population in populateCache is updated in the same commit because it is logically atomic with the versioning changes: the graph cache is the unversioned, merged view used by pathfinding, so it must be populated with data from all gossip versions. Without this change, only v1 data would be loaded into the cache, making v2 nodes and channels invisible to pathfinding.
This commit is contained in:
6 files changed
+87
-64
No files matched your search
@@ -33,7 +33,7 @@ type NodeTraverser interface {
|
||||
type Store interface { //nolint:interfacebloat
|
||||
// ForEachNodeDirectedChannel calls the callback for every channel of
|
||||
// the given node.
|
||||
ForEachNodeDirectedChannel(nodePub route.Vertex,
|
||||
ForEachNodeDirectedChannel(v lnwire.GossipVersion, nodePub route.Vertex,
|
||||
cb func(channel *DirectedChannel) error, reset func()) error
|
||||
|
||||
// FetchNodeFeatures returns the features of the given node.
|
||||
|
||||
Reference in new issue
Block a user