mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-13 18:10:25 +02:00
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:
@@ -5,7 +5,7 @@ package devrpc
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
)
|
||||
|
||||
@@ -16,6 +16,6 @@ import (
|
||||
// also be specified.
|
||||
type Config struct {
|
||||
ActiveNetParams *chaincfg.Params
|
||||
GraphDB *channeldb.ChannelGraph
|
||||
GraphDB *graphdb.ChannelGraph
|
||||
Switch *htlcswitch.Switch
|
||||
}
|
||||
|
@@ -16,8 +16,8 @@ import (
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/graph/db/models"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
@@ -227,7 +227,7 @@ func (s *Server) ImportGraph(ctx context.Context,
|
||||
|
||||
var err error
|
||||
for _, rpcNode := range graph.Nodes {
|
||||
node := &channeldb.LightningNode{
|
||||
node := &graphdb.LightningNode{
|
||||
HaveNodeAnnouncement: true,
|
||||
LastUpdate: time.Unix(
|
||||
int64(rpcNode.LastUpdate), 0,
|
||||
|
Reference in New Issue
Block a user