lnd/graph
Elle Mouton 4486b5261d
graph/db: allow async cache population
Introduce graphCacheState, a wrapper around GraphCache that tracks its
population lifecycle (loading -> loaded) and buffers concurrent mutations
during the initial DB scan. Once population completes, buffered updates
are replayed and the cache begins serving reads.

Start() now launches populateCache in a background goroutine by default.
While the cache is loading, all graph reads fall back to the database.
The KV iterators (ForEachNodeCacheable, ForEachChannelCacheable) now
respect context cancellation so that Stop() can interrupt a long-running
population.

Tests cover: concurrent reads during population, concurrent write replay,
shutdown cancellation during load, population failure with DB fallback,
and KV iterator cancellation.
2026-03-24 09:49:23 +02:00
..
db graph/db: allow async cache population 2026-03-24 09:49:23 +02:00
testdata refactor: move various duties from ChannelRouter to graph.Builder 2024-07-15 15:56:33 +02:00
builder.go graph/db: version ChannelView and add v2 queries 2026-03-16 11:29:41 +02:00
builder_test.go graph,discovery: version IsZombieChannel 2026-03-16 11:29:40 +02:00
errors.go multi: use the "errors" package everywhere 2025-06-30 09:46:55 +02:00
interfaces.go graph/db: version MarkEdgeLive 2026-03-16 11:25:31 +02:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
notifications_test.go graph/tests: make createChannelEdge assert internally 2026-02-25 11:34:05 +02:00
setup_test.go refactor: move various duties from ChannelRouter to graph.Builder 2024-07-15 15:56:33 +02:00
stats.go graph: rename routerStats to builderStats 2025-02-07 13:01:39 +02:00