refactor: move graph related DB code to graph/db from channeldb

This is a pure refactor commit. It moves over all the graph related CRUD
code from `channeldb` to `graph/db`.
This commit is contained in:
Elle Mouton
2024-10-22 13:35:23 +02:00
parent 9f54ec90aa
commit 74a4b1922b
57 changed files with 512 additions and 299 deletions

View File

@@ -28,6 +28,7 @@ import (
"github.com/lightningnetwork/lnd/feature"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/funding"
graphdb "github.com/lightningnetwork/lnd/graph/db"
"github.com/lightningnetwork/lnd/graph/db/models"
"github.com/lightningnetwork/lnd/htlcswitch"
"github.com/lightningnetwork/lnd/htlcswitch/hodl"
@@ -235,7 +236,7 @@ type Config struct {
// ChannelGraph is a pointer to the channel graph which is used to
// query information about the set of known active channels.
ChannelGraph *channeldb.ChannelGraph
ChannelGraph *graphdb.ChannelGraph
// ChainArb is used to subscribe to channel events, update contract signals,
// and force close channels.
@@ -1098,7 +1099,7 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
info, p1, p2, err := graph.FetchChannelEdgesByOutpoint(
&chanPoint,
)
if err != nil && !errors.Is(err, channeldb.ErrEdgeNotFound) {
if err != nil && !errors.Is(err, graphdb.ErrEdgeNotFound) {
return nil, err
}