autopilot: continue threading context

Remove one context.TODO and add one more.
This commit is contained in:
Elle Mouton
2025-04-09 06:31:05 +02:00
committed by ziggie
parent cd4a59071d
commit 46f09ba1ff
5 changed files with 17 additions and 7 deletions

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
}