diff --git a/package.json b/package.json index 909c3e5..90e9448 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@magiceden-oss/runestone-lib", - "version": "0.9.2-alpha", + "version": "0.9.3-alpha", "description": "", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/src/indexer/index.ts b/src/indexer/index.ts index 61c8bcb..507b783 100644 --- a/src/indexer/index.ts +++ b/src/indexer/index.ts @@ -13,8 +13,7 @@ export class RunestoneIndexer { private readonly _network: Network; private _started: boolean = false; - private _updateInProgress: Promise | null = null; - private _intervalId: NodeJS.Timeout | null = null; + private _updateInProgress: boolean = false; constructor(options: RunestoneIndexerOptions) { this._rpc = options.bitcoinRpcClient; @@ -51,11 +50,6 @@ export class RunestoneIndexer { return; } - if (this._intervalId !== null) { - clearInterval(this._intervalId); - this._intervalId = null; - } - await this._storage.disconnect(); this._started = false; } @@ -69,11 +63,11 @@ export class RunestoneIndexer { return; } - this._updateInProgress = this.updateRuneUtxoBalancesImpl(); + this._updateInProgress = true; try { - await this._updateInProgress; + await this.updateRuneUtxoBalancesImpl(); } finally { - this._updateInProgress = null; + this._updateInProgress = false; } }