graph: remove one context.TODO

By threading a context through to the Builder's ForAllOutgoingChannels
method.
This commit is contained in:
Elle Mouton
2025-07-08 11:55:14 +02:00
parent 3d5e852c8c
commit 793c1057bb
4 changed files with 11 additions and 10 deletions

View File

@@ -1275,10 +1275,9 @@ func (b *Builder) FetchLightningNode(ctx context.Context,
// the router.
//
// NOTE: This method is part of the ChannelGraphSource interface.
func (b *Builder) ForAllOutgoingChannels(cb func(*models.ChannelEdgeInfo,
*models.ChannelEdgePolicy) error) error {
ctx := context.TODO()
func (b *Builder) ForAllOutgoingChannels(ctx context.Context,
cb func(*models.ChannelEdgeInfo,
*models.ChannelEdgePolicy) error) error {
return b.cfg.Graph.ForEachNodeChannel(ctx, b.cfg.SelfNode,
func(c *models.ChannelEdgeInfo, e *models.ChannelEdgePolicy,

View File

@@ -70,8 +70,9 @@ type ChannelGraphSource interface {
// ForAllOutgoingChannels is used to iterate over all channels
// emanating from the "source" node which is the center of the
// star-graph.
ForAllOutgoingChannels(cb func(c *models.ChannelEdgeInfo,
e *models.ChannelEdgePolicy) error) error
ForAllOutgoingChannels(ctx context.Context,
cb func(c *models.ChannelEdgeInfo,
e *models.ChannelEdgePolicy) error) error
// CurrentBlockHeight returns the block height from POV of the router
// subsystem.