mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 18:10:48 +02:00
refactor: create FetchLightningNode with no tx param
In preparation for adding a clean Graph DB interface, we create a version of FetchLightningNode that doesnt allow a caller to provide in a transaction.
This commit is contained in:
@ -2915,7 +2915,7 @@ func (r *ChannelRouter) GetChannelByID(chanID lnwire.ShortChannelID) (
|
||||
func (r *ChannelRouter) FetchLightningNode(
|
||||
node route.Vertex) (*channeldb.LightningNode, error) {
|
||||
|
||||
return r.cfg.Graph.FetchLightningNode(nil, node)
|
||||
return r.cfg.Graph.FetchLightningNode(node)
|
||||
}
|
||||
|
||||
// ForEachNode is used to iterate over every node in router topology.
|
||||
|
@ -1596,14 +1596,14 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
_, _, err = ctx.router.FindRoute(req)
|
||||
require.NoError(t, err, "unable to find any routes")
|
||||
|
||||
copy1, err := ctx.graph.FetchLightningNode(nil, pub1)
|
||||
copy1, err := ctx.graph.FetchLightningNode(pub1)
|
||||
require.NoError(t, err, "unable to fetch node")
|
||||
|
||||
if copy1.Alias != n1.Alias {
|
||||
t.Fatalf("fetched node not equal to original")
|
||||
}
|
||||
|
||||
copy2, err := ctx.graph.FetchLightningNode(nil, pub2)
|
||||
copy2, err := ctx.graph.FetchLightningNode(pub2)
|
||||
require.NoError(t, err, "unable to fetch node")
|
||||
|
||||
if copy2.Alias != n2.Alias {
|
||||
|
Reference in New Issue
Block a user