@@ -11,7 +11,6 @@ export class RunestoneIndexer {
1111 private readonly _storage : RunestoneStorage ;
1212 private readonly _rpc : BitcoinRpcClient ;
1313 private readonly _network : Network ;
14- private readonly _pollIntervalMs : number | null ;
1514
1615 private _started : boolean = false ;
1716 private _updateInProgress : Promise < void > | null = null ;
@@ -21,8 +20,6 @@ export class RunestoneIndexer {
2120 this . _rpc = options . bitcoinRpcClient ;
2221 this . _storage = options . storage ;
2322 this . _network = options . network ;
24- this . _pollIntervalMs =
25- options . pollIntervalMs !== null ? Math . max ( options . pollIntervalMs ?? 10000 , 0 ) : null ;
2623 }
2724
2825 async start ( ) : Promise < void > {
@@ -34,10 +31,6 @@ export class RunestoneIndexer {
3431
3532 this . _started = true ;
3633
37- if ( this . _pollIntervalMs !== null ) {
38- this . _intervalId = setInterval ( ( ) => this . updateRuneUtxoBalances ( ) , this . _pollIntervalMs ) ;
39- }
40-
4134 if ( this . _network === Network . MAINNET ) {
4235 this . _storage . seedEtchings ( [
4336 {
@@ -68,6 +61,10 @@ export class RunestoneIndexer {
6861 }
6962
7063 async updateRuneUtxoBalances ( ) : Promise < void > {
64+ if ( ! this . _started ) {
65+ throw new Error ( 'Runestone indexer is not started' ) ;
66+ }
67+
7168 if ( this . _updateInProgress ) {
7269 return ;
7370 }
0 commit comments