lnd/graph/db
Elle Mouton 1e35f258e4
graph/db: add gossip version parameter to ForEachNodeChannel
Update ForEachNodeChannel to accept a gossip version parameter,
allowing callers to specify which gossip version's channels should be
iterated. This change mirrors the approach taken in ForEachChannel and
prepares the graph database for supporting multiple gossip versions
while maintaining backward compatibility.

The Store interface is updated to include the version parameter, and
both KVStore and SQLStore implementations are updated accordingly:

- KVStore validates that only GossipVersion1 is requested, returning
  ErrVersionNotSupportedForKVDB for other versions.
- SQLStore passes the version through to the underlying node query,
  enabling version-specific channel iteration.

The ChannelGraph wrapper is updated to accept and pass through the
version parameter. VersionedGraph gains a ForEachNodeChannel method
that automatically uses its configured gossip version, providing a
clean interface for version-specific operations.

Update all call sites to explicitly pass lnwire.GossipVersion1, except
for the local channel manager in server.go which now uses the v1Graph
directly (matching the pattern used in other parts of the codebase).
2026-02-13 07:21:24 +02:00
..
migration1 graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00
models multi: add ChanEdgePolicyFromWire constructor for ChannelEdgePolicy 2026-02-13 07:21:24 +02:00
addr.go graph/db+chanbackup: dns add encoding/decoding for persistence 2025-09-03 01:11:35 +00:00
addr_test.go graph/db+chanbackup: dns add encoding/decoding for persistence 2025-09-03 01:11:35 +00:00
benchmark_test.go graph/db: add gossip version parameter to ForEachChannel 2026-02-13 07:21:24 +02:00
channel_cache.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
channel_cache_test.go multi: add and use V1 constructor for models.ChannelEdgeInfo 2026-02-13 07:21:22 +02:00
codec.go channeldb/graphdb: move outpoint ser/deser funcs to graphdb 2024-11-28 13:34:08 +02:00
errors.go graph/db: let IsZombieEdge return an error 2025-06-26 10:19:51 +02:00
graph.go graph/db: add gossip version parameter to ForEachNodeChannel 2026-02-13 07:21:24 +02:00
graph_cache.go graph/db: refactor CachedEdgePolicy to use explicit boolean fields 2026-02-13 07:21:24 +02:00
graph_cache_test.go graph/db: refactor CachedEdgePolicy to use explicit boolean fields 2026-02-13 07:21:24 +02:00
graph_test.go graph/db: add gossip version parameter to ForEachNodeChannel 2026-02-13 07:21:24 +02:00
interfaces.go graph/db: add gossip version parameter to ForEachNodeChannel 2026-02-13 07:21:24 +02:00
kv_store.go graph/db: add gossip version parameter to ForEachNodeChannel 2026-02-13 07:21:24 +02:00
kv_store_features_test.go graphdb: fix backwards-compat for channel edge feature deserialization 2026-02-03 09:12:04 -08:00
log.go graph/db+log: use v2 logger for graph subsystem 2025-07-29 11:34:47 +02:00
notifications.go multi: add models.Node V1 constructor 2025-11-12 22:54:05 +08:00
options.go graph/db: add options infrastructure for iterator configuration 2025-09-26 16:56:20 -07:00
reject_cache.go graph/db: add versioned HasChannelEdge method 2026-02-13 07:21:24 +02:00
reject_cache_test.go graph/db: version reject cache for policies 2026-02-13 07:21:24 +02:00
setup_test.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
sql_store.go graph/db: add gossip version parameter to ForEachNodeChannel 2026-02-13 07:21:24 +02:00
test_kvdb.go graph/db: add helper variable for tests 2026-02-13 07:21:21 +02:00
test_postgres.go graph/db: add helper variable for tests 2026-02-13 07:21:21 +02:00
test_sqlite.go graph/db: add helper variable for tests 2026-02-13 07:21:21 +02:00