autopilot: convert Peer to route.Vertex
In preparation for removing the ForEachNode/ForEachChannel call pattern, we refactor the autopilot subserver by simplifying the `ChannelEdge` such that it no longer returns the `Node` type which has a `ForEachChannel` method on it. The aim is to completely remove the `ForEachChannel` usage.
This commit is contained in:
4 files changed
+18
-24
No files matched your search
+2
-6
@@ -106,9 +106,7 @@ func (d *dbNode) ForEachChannel(ctx context.Context,
|
||||
edge := ChannelEdge{
|
||||
ChanID: lnwire.NewShortChanIDFromInt(ep.ChannelID),
|
||||
Capacity: ei.Capacity,
|
||||
Peer: &dbNode{
|
||||
tx: node,
|
||||
},
|
||||
Peer: node.Node().PubKeyBytes,
|
||||
}
|
||||
|
||||
return cb(ctx, edge)
|
||||
@@ -198,9 +196,7 @@ func (nc dbNodeCached) ForEachChannel(ctx context.Context,
|
||||
edge := ChannelEdge{
|
||||
ChanID: lnwire.NewShortChanIDFromInt(cid),
|
||||
Capacity: channel.Capacity,
|
||||
Peer: dbNodeCached{
|
||||
node: channel.OtherNode,
|
||||
},
|
||||
Peer: channel.OtherNode,
|
||||
}
|
||||
|
||||
if err := cb(ctx, edge); err != nil {
|
||||
|
||||
Reference in new issue
Block a user