Skip to content

Commit

Permalink
delete Older Blockhash and In scriptions from last block if inscripti…
Browse files Browse the repository at this point in the history
…on_number not found err
  • Loading branch information
crypticmeta committed Sep 1, 2024
1 parent 102f92f commit cf8f529
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions indexer/src/insertSkippedBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ export const handlePreSaveLogic = async (bulkDocs: Array<Partial<any>>) => {
});

if (!prevDocument || !prevDocument.inscription_id) {
await BlockHashes.deleteOne({block_height: prevDocument.genesis_height - 1});
await Inscription.deleteMany({genesis_height: prevDocument.genesis_height - 1})
throw new Error(
`1) A document with number ${
doc.inscription_number - 1
Expand Down

0 comments on commit cf8f529

Please sign in to comment.