mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
multi: move DB schemas to channeldb/models
This commit moves the ChannelEdgePolicy, ChannelEdgeInfo, ChanelAuthProof and CachedEdgePolicy structs to the `channeldb/models` package.
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/chanbackup"
|
||||
"github.com/lightningnetwork/lnd/chanfitness"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/channeldb/models"
|
||||
"github.com/lightningnetwork/lnd/channelnotifier"
|
||||
"github.com/lightningnetwork/lnd/clock"
|
||||
"github.com/lightningnetwork/lnd/contractcourt"
|
||||
@@ -1232,7 +1233,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
// Wrap the DeleteChannelEdges method so that the funding manager can
|
||||
// use it without depending on several layers of indirection.
|
||||
deleteAliasEdge := func(scid lnwire.ShortChannelID) (
|
||||
*channeldb.ChannelEdgePolicy, error) {
|
||||
*models.ChannelEdgePolicy, error) {
|
||||
|
||||
info, e1, e2, err := s.graphDB.FetchChannelEdgesByID(
|
||||
scid.ToUint64(),
|
||||
@@ -1251,7 +1252,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
var ourKey [33]byte
|
||||
copy(ourKey[:], nodeKeyDesc.PubKey.SerializeCompressed())
|
||||
|
||||
var ourPolicy *channeldb.ChannelEdgePolicy
|
||||
var ourPolicy *models.ChannelEdgePolicy
|
||||
if info != nil && info.NodeKey1Bytes == ourKey {
|
||||
ourPolicy = e1
|
||||
} else {
|
||||
@@ -3094,8 +3095,8 @@ func (s *server) establishPersistentConnections() error {
|
||||
selfPub := s.identityECDH.PubKey().SerializeCompressed()
|
||||
err = s.graphDB.ForEachNodeChannel(nil, sourceNode.PubKeyBytes, func(
|
||||
tx kvdb.RTx,
|
||||
chanInfo *channeldb.ChannelEdgeInfo,
|
||||
policy, _ *channeldb.ChannelEdgePolicy) error {
|
||||
chanInfo *models.ChannelEdgeInfo,
|
||||
policy, _ *models.ChannelEdgePolicy) error {
|
||||
|
||||
// If the remote party has announced the channel to us, but we
|
||||
// haven't yet, then we won't have a policy. However, we don't
|
||||
|
Reference in New Issue
Block a user