From 6ca06c8343484721bb35af91798d5b472a15723c Mon Sep 17 00:00:00 2001 From: billettc Date: Thu, 4 Apr 2024 17:30:49 -0400 Subject: [PATCH] prevent scanning all undos entry ... --- db/db.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 96f37c1..e6412c0 100644 --- a/db/db.go +++ b/db/db.go @@ -140,7 +140,7 @@ func (db *OperationDB) Flush(ctx context.Context, cursor *sink.Cursor) (count in func (db *OperationDB) PurgeUndoOperations(ctx context.Context, finalBlockHeight uint64) error { keys := make([][]byte, 0) - scanOutput := db.store.Scan(ctx, undoKey(finalBlockHeight), undoKey(0), 0) + scanOutput := db.store.Scan(ctx, undoKey(finalBlockHeight), undoKey(finalBlockHeight-1000), 0) if scanOutput.Err() != nil { return fmt.Errorf("scanning undo operations for block %d: %w", finalBlockHeight, scanOutput.Err())