autopilot: continue threading context

Remove one context.TODO and add one more.
This commit is contained in:
Elle Mouton committed 2025-05-22 14:14:38 +02:00
1 parent 13fcb08794
commit 1c6c6436af
5 files changed
+17 -7

No files matched your search

+4 -1
View File
@@ -1,6 +1,7 @@
package autopilot
import (
"context"
"runtime"
"github.com/btcsuite/btcd/btcutil"
@@ -54,8 +55,10 @@ func (g *TopCentrality) NodeScores(graph ChannelGraph, chans []LocalChannel,
chanSize btcutil.Amount, nodes map[NodeID]struct{}) (
map[NodeID]*NodeScore, error) {
ctx := context.TODO()
// Calculate betweenness centrality for the whole graph.
if err := g.centralityMetric.Refresh(graph); err != nil {
if err := g.centralityMetric.Refresh(ctx, graph); err != nil {
return nil, err
}