graph/db: version ForEachSourceNodeChannel

Add a gossip version parameter to ForEachSourceNodeChannel in the Store
interface and both KV/SQL implementations. The VersionedGraph wrapper
delegates with its baked-in version. Convert the
testAddChannelEdgeShellNodes and testForEachSourceNodeChannel tests to
run against both v1 and v2 gossip versions.
This commit is contained in:
Elle Mouton committed 2026-02-20 08:46:58 +02:00
1 parent 2aaa52adf9
commit 3ea2423f25
6 files changed
+85 -59

No files matched your search

+5 -2
View File
@@ -1128,7 +1128,7 @@ func newServer(ctx context.Context, cfg *Config, listenAddrs []net.Addr,
DefaultRoutingPolicy: cc.RoutingPolicy,
ForAllOutgoingChannels: func(ctx context.Context,
cb func(*models.ChannelEdgeInfo,
*models.ChannelEdgePolicy) error,
*models.ChannelEdgePolicy) error,
reset func()) error {
return s.v1Graph.ForEachNodeChannel(
@@ -3576,7 +3576,10 @@ func (s *server) establishPersistentConnections(ctx context.Context) error {
graphAddrs[pubStr] = n
return nil
}
err = s.graphDB.ForEachSourceNodeChannel(
// TODO(elle): for now, we only fetch our V1 channels. This should be
// updated to fetch channels across all versions.
err = s.v1Graph.ForEachSourceNodeChannel(
ctx, forEachSrcNodeChan, func() {
clear(graphAddrs)
},