graph/db: let ForEachNode take a context

This commit is contained in:
Elle Mouton
2025-07-07 09:46:23 +02:00
parent f05ef2db97
commit 1e804a3d5f
8 changed files with 14 additions and 14 deletions

View File

@@ -123,7 +123,7 @@ func (d *dbNode) ForEachChannel(ctx context.Context,
func (d *databaseChannelGraph) ForEachNode(ctx context.Context,
cb func(context.Context, Node) error) error {
return d.db.ForEachNode(func(nodeTx graphdb.NodeRTx) error {
return d.db.ForEachNode(ctx, func(nodeTx graphdb.NodeRTx) error {
// We'll skip over any node that doesn't have any advertised
// addresses. As we won't be able to reach them to actually
// open any channels.

View File

@@ -228,7 +228,7 @@ type GraphSource interface {
// the callback returns an error, then the transaction is aborted and
// the iteration stops early. Any operations performed on the NodeTx
// passed to the call-back are executed under the same read transaction.
ForEachNode(func(graphdb.NodeRTx) error) error
ForEachNode(context.Context, func(graphdb.NodeRTx) error) error
// ForEachNodeCached is similar to ForEachNode, but it utilizes the
// channel graph cache if one is available. It is less consistent than