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:
9 files changed
+96
-26
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user