Skip to content

Commit

Permalink
Catch cursor.continue() errors (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone authored Oct 10, 2024
1 parent bb8412e commit ccb90c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ export class Database {
// Append the TXID from the Index key
cursor.value.txid = cursor.key;
txs.push(cursor.value);
await cursor.continue();
try {
await cursor.continue();
} catch {
break;
}
}

// Now convert the raw TX components to Transaction Classes
Expand Down Expand Up @@ -456,7 +460,11 @@ export class Database {
if (cursor.value.blockHeight === -1) {
await cursor.delete();
}
cursor = await cursor.continue();
try {
cursor = await cursor.continue();
} catch {
break;
}
}
})();
}
Expand Down

0 comments on commit ccb90c5

Please sign in to comment.