multi: remove LightningNode from ChannelEdgePolicy

Finally, The LightningNode object is removed from ChannelEdgePolicy.
This is a step towards letting ChannelEdgePolicy reflect exactly the
schema that is on disk.

This is also nice because the `Node` object is not necessarily always
required when the ChannelEdgePolicy is loaded from the DB, so now it
only get's loaded when needed.
This commit is contained in:
Elle Mouton committed 2023-11-08 14:50:34 +02:00
1 parent 6c76d31e89
commit 3a17479ff4
9 files changed
+114 -130

No files matched your search

+10 -6
View File
@@ -280,10 +280,12 @@ func (c *ChanSeries) FetchChanAnns(chain chainhash.Hash,
// If this edge has a validated node announcement, that
// we haven't yet sent, then we'll send that as well.
nodePub := channel.Policy1.Node.PubKeyBytes
hasNodeAnn := channel.Policy1.Node.HaveNodeAnnouncement
nodePub := channel.Node2.PubKeyBytes
hasNodeAnn := channel.Node2.HaveNodeAnnouncement
if _, ok := nodePubsSent[nodePub]; !ok && hasNodeAnn {
nodeAnn, err := channel.Policy1.Node.NodeAnnouncement(true)
nodeAnn, err := channel.Node2.NodeAnnouncement(
true,
)
if err != nil {
return nil, err
}
@@ -297,10 +299,12 @@ func (c *ChanSeries) FetchChanAnns(chain chainhash.Hash,
// If this edge has a validated node announcement, that
// we haven't yet sent, then we'll send that as well.
nodePub := channel.Policy2.Node.PubKeyBytes
hasNodeAnn := channel.Policy2.Node.HaveNodeAnnouncement
nodePub := channel.Node1.PubKeyBytes
hasNodeAnn := channel.Node1.HaveNodeAnnouncement
if _, ok := nodePubsSent[nodePub]; !ok && hasNodeAnn {
nodeAnn, err := channel.Policy2.Node.NodeAnnouncement(true)
nodeAnn, err := channel.Node1.NodeAnnouncement(
true,
)
if err != nil {
return nil, err
}