multi: pass reset to ForEachNodeCached

This commit is contained in:
Elle Mouton committed 2025-07-15 11:23:27 +02:00
1 parent e5fbca8299
commit c32bf642d2
14 files changed
+61 -25

No files matched your search

+3 -3
View File
@@ -121,7 +121,7 @@ func (d *dbNode) ForEachChannel(ctx context.Context,
//
// NOTE: Part of the autopilot.ChannelGraph interface.
func (d *databaseChannelGraph) ForEachNode(ctx context.Context,
cb func(context.Context, Node) error) error {
cb func(context.Context, Node) error, _ func()) error {
return d.db.ForEachNode(ctx, func(nodeTx graphdb.NodeRTx) error {
// We'll skip over any node that doesn't have any advertised
@@ -217,7 +217,7 @@ func (nc dbNodeCached) ForEachChannel(ctx context.Context,
//
// NOTE: Part of the autopilot.ChannelGraph interface.
func (dc *databaseChannelGraphCached) ForEachNode(ctx context.Context,
cb func(context.Context, Node) error) error {
cb func(context.Context, Node) error, reset func()) error {
return dc.db.ForEachNodeCached(ctx, func(n route.Vertex,
channels map[uint64]*graphdb.DirectedChannel) error {
@@ -231,7 +231,7 @@ func (dc *databaseChannelGraphCached) ForEachNode(ctx context.Context,
return cb(ctx, node)
}
return nil
})
}, reset)
}
// memNode is a purely in-memory implementation of the autopilot.Node