autopilot: update AttachmentHeuristics with context

Continue threading context through the autopilot system and remove the
remaining context.TODOs.
This commit is contained in:
Elle Mouton
2025-04-09 06:36:02 +02:00
parent 1c6c6436af
commit 3f218dfbbe
12 changed files with 41 additions and 37 deletions

View File

@@ -79,11 +79,9 @@ func (p *PrefAttachment) Name() string {
// given to nodes already having high connectivity in the graph.
//
// NOTE: This is a part of the AttachmentHeuristic interface.
func (p *PrefAttachment) NodeScores(g ChannelGraph, chans []LocalChannel,
chanSize btcutil.Amount, nodes map[NodeID]struct{}) (
map[NodeID]*NodeScore, error) {
ctx := context.TODO()
func (p *PrefAttachment) NodeScores(ctx context.Context, g ChannelGraph,
chans []LocalChannel, chanSize btcutil.Amount,
nodes map[NodeID]struct{}) (map[NodeID]*NodeScore, error) {
// We first run though the graph once in order to find the median
// channel size.