Make sure to re-index skipped block when backend is offline for too long
This commit is contained in:
parent
ae13f6119e
commit
7f8696c88d
@ -201,13 +201,12 @@ class Blocks {
|
||||
return;
|
||||
}
|
||||
|
||||
this.reindexFlag = false;
|
||||
|
||||
const blockchainInfo = await bitcoinClient.getBlockchainInfo();
|
||||
if (blockchainInfo.blocks !== blockchainInfo.headers) { // Wait for node to sync
|
||||
return;
|
||||
}
|
||||
|
||||
this.reindexFlag = false;
|
||||
this.blockIndexingStarted = true;
|
||||
this.blockIndexingCompleted = false;
|
||||
|
||||
@ -299,6 +298,7 @@ class Blocks {
|
||||
logger.info(`${blockHeightTip - this.currentBlockHeight} blocks since tip. Fast forwarding to the ${config.MEMPOOL.INITIAL_BLOCKS_AMOUNT} recent blocks`);
|
||||
this.currentBlockHeight = blockHeightTip - config.MEMPOOL.INITIAL_BLOCKS_AMOUNT;
|
||||
fastForwarded = true;
|
||||
this.reindexFlag = true; // Make sure to index the skipped blocks #1619
|
||||
}
|
||||
|
||||
if (!this.lastDifficultyAdjustmentTime) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user