graph/db: let ForEachNodeCached maybe fetch node addresses

Here we adjust the ForEachNodeCached graph DB method to pass in a node's
addresses into the provided call-back if requested. This will allow us
to improve the performance of node/channel iteration in the autopilot
subserver.
This commit is contained in:
Elle Mouton committed 2025-08-06 09:50:54 +02:00
1 parent ae566744c4
commit 5727bfa688
9 files changed
+96 -26

No files matched your search

+4 -1
View File
@@ -5,6 +5,7 @@ import (
"database/sql"
"errors"
"fmt"
"net"
"os"
"path"
"sync"
@@ -721,7 +722,9 @@ func BenchmarkGraphReadMethods(b *testing.B) {
fn: func(b testing.TB, store V1Store) {
//nolint:ll
err := store.ForEachNodeCached(
ctx, func(route.Vertex,
ctx, false, func(context.Context,
route.Vertex,
[]net.Addr,
map[uint64]*DirectedChannel) error {
// Increment the counter to