mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
autopilot: continue threading context
Remove one context.TODO and add one more.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user