mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 15:11:09 +02:00
graph/db: thread context through to FetchLightingNode
This commit is contained in:
@@ -395,6 +395,8 @@ func TestPrefAttachmentSelectSkipNodes(t *testing.T) {
|
||||
func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
|
||||
capacity btcutil.Amount) (*ChannelEdge, *ChannelEdge, error) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
fetchNode := func(pub *btcec.PublicKey) (*models.LightningNode, error) {
|
||||
if pub != nil {
|
||||
vertex, err := route.NewVertexFromBytes(
|
||||
@@ -404,7 +406,7 @@ func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dbNode, err := d.db.FetchLightningNode(vertex)
|
||||
dbNode, err := d.db.FetchLightningNode(ctx, vertex)
|
||||
switch {
|
||||
case errors.Is(err, graphdb.ErrGraphNodeNotFound):
|
||||
fallthrough
|
||||
@@ -737,7 +739,7 @@ func (t *testNodeTx) ForEachChannel(f func(*models.ChannelEdgeInfo,
|
||||
}
|
||||
|
||||
func (t *testNodeTx) FetchNode(pub route.Vertex) (graphdb.NodeRTx, error) {
|
||||
node, err := t.db.db.FetchLightningNode(pub)
|
||||
node, err := t.db.db.FetchLightningNode(context.Background(), pub)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user