lnd/graph/db
Elle Mouton 14cedef58e
graph/db: add NodeRTx interface and implement it
In this commit, a new NodeRTx interface is added which represents
consistent access to a persisted models.LightningNode. The
ForEachChannel method of the interface gives the caller access to the
node's channels under the same read transaction (if any) that was used
to fetch the node in the first place. The FetchNode method returns
another NodeRTx which again will have the same underlying read
transaction.

The main point of this interface is to provide this consistent access
without needing to expose the `kvdb.RTx` type as a method parameter.
This will then make it much easier in future to add new implementations
of this interface that are backed by other databases (or RPC
connections) where the `kvdb.RTx` type does not apply.

We will make use of the new interface in the `autopilot` package in
upcoming commits in order to remove the `autopilot`'s dependence on the
pointer to the `*graphdb.ChannelGraph` which it has today.
2025-02-10 08:23:58 +02:00
..
models models: create a helper to convert wire NodeAnn to models.LNNode type 2025-02-05 08:20:10 +02:00
addr.go graph/db: de(ser)ialise opaque node addrs 2025-02-05 12:41:50 +02:00
addr_test.go channeldb+graph/db: move net.Addr encode/decode to graph db package 2024-11-28 13:34:08 +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 refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
codec.go channeldb/graphdb: move outpoint ser/deser funcs to graphdb 2024-11-28 13:34:08 +02:00
errors.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
graph.go graph/db: add NodeRTx interface and implement it 2025-02-10 08:23:58 +02:00
graph_cache.go multi: add debug logs for edge policy flow 2025-01-17 00:17:23 +08:00
graph_cache_test.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
graph_test.go graph/db: de(ser)ialise opaque node addrs 2025-02-05 12:41:50 +02:00
interfaces.go graph/db: add NodeRTx interface and implement it 2025-02-10 08:23:58 +02:00
log.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
options.go channeldb+graphdb: init graph DB outside of channel db 2024-11-28 13:36:15 +02:00
reject_cache.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
reject_cache_test.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00
setup_test.go refactor: move graph related DB code to graph/db from channeldb 2024-11-28 13:36:13 +02:00