Skip to content

Commit 81ce05f

Browse files
committed
graph/db: start lastID for pagination at -1
Just to be very sure that we don't miss a valid ID.
1 parent 23c8f70 commit 81ce05f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graph/db/sql_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ func (s *SQLStore) ForEachChannel(cb func(*models.ChannelEdgeInfo,
13951395
}
13961396

13971397
return s.db.ExecTx(ctx, sqldb.ReadTxOpt(), func(db SQLQueries) error {
1398-
var lastID int64
1398+
lastID := int64(-1)
13991399
for {
14001400
//nolint:ll
14011401
rows, err := db.ListChannelsWithPoliciesPaginated(
@@ -2957,7 +2957,7 @@ func forEachNodeDirectedChannel(ctx context.Context, db SQLQueries,
29572957
func forEachNodeCacheable(ctx context.Context, db SQLQueries,
29582958
cb func(nodeID int64, nodePub route.Vertex) error) error {
29592959

2960-
var lastID int64
2960+
lastID := int64(-1)
29612961

29622962
for {
29632963
nodes, err := db.ListNodeIDsAndPubKeys(

0 commit comments

Comments
 (0)