Commit Graph

4 Commits

Author SHA1 Message Date
Elle Mouton
237151d9df netann+lnd: add netann.ChannelGraph to the GraphSource interface
And let DBSource implement it.
2024-11-28 14:52:49 +02:00
Elle Mouton
6f3d45f5d9 invoicesrpc: remove invoicerpc server's access to ChannelGraph pointer
Define a new GraphSource interface required by the invoicerpc server and
remove its access to the graphdb.ChannelGraph pointer. Add the new
invoicesrpc.GraphSource interface to the GraphSource interface
and let DBSource implement it.
2024-11-28 14:52:48 +02:00
Elle Mouton
aa2480464b graph: add ReadOnlyGraph interface to GraphSource interface
In this commit, we take the existing graphsession.ReadyOnlyGraph
interface and remove its usage of a kvdb.RTx and replace it with a more
abstract `RTx` interface type.

The new GraphSource interface is expanded to include the
graphsession.ReadOnlyGraph interface and the implementation of it,
DBSource, is expanded to include the new methods. It converts the
given RTx to the underlying kvdb read transaction where needed.
2024-11-28 14:52:48 +02:00
Elle Mouton
6c008ff8fb lnd+graph: add GraphSource interface and implementation
This commit adds a new GraphSources interface that LND requires for
graph related read-only queries. As of this commit, the interface is
empty but it will be populated over the next couple of commits. We add
an implementation of this interface backed by a pointer to a
graphdb.ChannelGraph.

The infrustructure is put into place so that the GraphSoure provided to
LND can be overridden by a caller of the lnd.Main function. By default,
LND will satisfy the interface itself via the new `graphsource.DBSource`
struct.
2024-11-28 14:52:48 +02:00