mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
autopilot: update AttachmentHeuristics with context
Continue threading context through the autopilot system and remove the remaining context.TODOs.
This commit is contained in:
@@ -51,11 +51,9 @@ func (g *TopCentrality) Name() string {
|
||||
// As our current implementation of betweenness centrality is non-incremental,
|
||||
// NodeScores will recalculate the centrality values on every call, which is
|
||||
// slow for large graphs.
|
||||
func (g *TopCentrality) NodeScores(graph ChannelGraph, chans []LocalChannel,
|
||||
chanSize btcutil.Amount, nodes map[NodeID]struct{}) (
|
||||
map[NodeID]*NodeScore, error) {
|
||||
|
||||
ctx := context.TODO()
|
||||
func (g *TopCentrality) NodeScores(ctx context.Context, graph ChannelGraph,
|
||||
chans []LocalChannel, chanSize btcutil.Amount,
|
||||
nodes map[NodeID]struct{}) (map[NodeID]*NodeScore, error) {
|
||||
|
||||
// Calculate betweenness centrality for the whole graph.
|
||||
if err := g.centralityMetric.Refresh(ctx, graph); err != nil {
|
||||
|
Reference in New Issue
Block a user