mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
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:
@@ -104,6 +104,11 @@ func (d *dbNode) ForEachChannel(cb func(ChannelEdge) error) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
node, err := d.db.FetchLightningNode(tx, ep.ToNode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
edge := ChannelEdge{
|
||||
ChanID: lnwire.NewShortChanIDFromInt(
|
||||
ep.ChannelID,
|
||||
@@ -112,7 +117,7 @@ func (d *dbNode) ForEachChannel(cb func(ChannelEdge) error) error {
|
||||
Peer: &dbNode{
|
||||
tx: tx,
|
||||
db: d.db,
|
||||
node: ep.Node,
|
||||
node: node,
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user