graph/db: start lastID for pagination at -1

Just to be very sure that we don't miss a valid ID.
This commit is contained in:
Elle Mouton committed 2025-06-25 13:26:53 +02:00
1 parent 23c8f7099c
commit 81ce05fced
1 file changed
+2 -2
+2 -2
View File
@@ -1395,7 +1395,7 @@ func (s *SQLStore) ForEachChannel(cb func(*models.ChannelEdgeInfo,
}
return s.db.ExecTx(ctx, sqldb.ReadTxOpt(), func(db SQLQueries) error {
var lastID int64
lastID := int64(-1)
for {
//nolint:ll
rows, err := db.ListChannelsWithPoliciesPaginated(
@@ -2957,7 +2957,7 @@ func forEachNodeDirectedChannel(ctx context.Context, db SQLQueries,
func forEachNodeCacheable(ctx context.Context, db SQLQueries,
cb func(nodeID int64, nodePub route.Vertex) error) error {
var lastID int64
lastID := int64(-1)
for {
nodes, err := db.ListNodeIDsAndPubKeys(