Added MEMPOOL.INDEXING_BLOCKS_AMOUNT in the config (default 432 blocks)

This commit is contained in:
nymkappa
2022-01-24 17:43:11 +09:00
parent a271c39ba8
commit 647f12ffaa
5 changed files with 23 additions and 9 deletions

View File

@@ -48,6 +48,10 @@ class BlocksRepository {
* Get all block height that have not been indexed between [startHeight, endHeight]
*/
public async $getMissingBlocksBetweenHeights(startHeight: number, endHeight: number): Promise<number[]> {
if (startHeight < endHeight) {
return [];
}
const connection = await DB.pool.getConnection();
const [rows] : any[] = await connection.query(`
SELECT height