mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
graph/db+autopilot: remove NodeRTx FetchNode method
In this commit, we remove the need for the NodeRTx interface to have the FetchNode method on it.
This commit is contained in:
@@ -98,15 +98,10 @@ func (d *dbNode) ForEachChannel(ctx context.Context,
|
||||
return nil
|
||||
}
|
||||
|
||||
node, err := d.tx.FetchNode(ep.ToNode)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
edge := ChannelEdge{
|
||||
ChanID: lnwire.NewShortChanIDFromInt(ep.ChannelID),
|
||||
Capacity: ei.Capacity,
|
||||
Peer: node.Node().PubKeyBytes,
|
||||
Peer: ep.ToNode,
|
||||
}
|
||||
|
||||
return cb(ctx, edge)
|
||||
|
@@ -742,16 +742,4 @@ func (t *testNodeTx) ForEachChannel(f func(*models.ChannelEdgeInfo,
|
||||
)
|
||||
}
|
||||
|
||||
func (t *testNodeTx) FetchNode(pub route.Vertex) (graphdb.NodeRTx, error) {
|
||||
node, err := t.db.db.FetchLightningNode(context.Background(), pub)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &testNodeTx{
|
||||
db: t.db,
|
||||
node: node,
|
||||
}, nil
|
||||
}
|
||||
|
||||
var _ graphdb.NodeRTx = (*testNodeTx)(nil)
|
||||
|
Reference in New Issue
Block a user