From 85a809fe1a0276f3658cc07f9945deecdd8da07a Mon Sep 17 00:00:00 2001 From: Robert Wei <138420544+me-rob@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:47:36 +0800 Subject: [PATCH] Reverse blockhash to index in reorg (#60) * Reverse blockhash to index in reorg * Use inplace reverse --- package.json | 2 +- src/indexer/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6441ad0..c32756d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@magiceden-oss/runestone-lib", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/indexer/index.ts b/src/indexer/index.ts index 507b783..f18d595 100644 --- a/src/indexer/index.ts +++ b/src/indexer/index.ts @@ -88,6 +88,7 @@ export class RunestoneIndexer { blockhash = (await this._rpc.getblockhash({ height: blockheight })).result; storageBlockHash = await this._storage.getBlockhash(blockheight); } + reorgBlockhashesToIndex.reverse(); // process blocks that are reorgs for (const blockhash of reorgBlockhashesToIndex) {