multi: let FetchLightningNode take an optional tx

In preparation for the next commit which will remove the
`*LightningNode` from the `ChannelEdgePolicy` struct,
`FetchLightningNode` is modified to take in an optional transaction so
that it can be utilised in places where a transaction exists.
This commit is contained in:
Elle Mouton
2023-10-23 14:21:24 +02:00
parent 9a62a46aa3
commit 6c76d31e89
9 changed files with 38 additions and 24 deletions

View File

@@ -6135,7 +6135,7 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
// With the public key decoded, attempt to fetch the node corresponding
// to this public key. If the node cannot be found, then an error will
// be returned.
node, err := graph.FetchLightningNode(pubKey)
node, err := graph.FetchLightningNode(nil, pubKey)
switch {
case err == channeldb.ErrGraphNodeNotFound:
return nil, status.Error(codes.NotFound, err.Error())
@@ -7107,7 +7107,7 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
return "", err
}
peer, err := r.server.graphDB.FetchLightningNode(vertex)
peer, err := r.server.graphDB.FetchLightningNode(nil, vertex)
if err != nil {
return "", err
}