Skip to content

Commit

Permalink
Use inplace reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
me-rob committed Apr 25, 2024
1 parent b507778 commit 9c88383
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/indexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ 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.toReversed()) {
for (const blockhash of reorgBlockhashesToIndex) {
const blockResult = await this._rpc.getblock({ blockhash, verbosity: 2 });
if (blockResult.error !== null) {
throw blockResult.error;
Expand Down

0 comments on commit 9c88383

Please sign in to comment.