Index more data using getblockstats core RPC

This commit is contained in:
nymkappa
2022-03-10 14:21:11 +01:00
parent d82f9c4998
commit 8ca3f6e72b
4 changed files with 23 additions and 45 deletions

View File

@@ -148,15 +148,12 @@ class DatabaseMigration {
logger.warn(`'blocks' table has been truncated. Re-indexing from scratch.`);
await this.$executeQuery(connection, 'TRUNCATE blocks;'); // Need to re-index
await this.$executeQuery(connection, `ALTER TABLE blocks
ADD avg_fee int unsigned NULL,
ADD avg_fee_rate int unsigned NULL,
ADD max_fee int unsigned NULL,
ADD max_fee_rate int unsigned NULL,
ADD min_fee int unsigned NULL,
ADD min_fee_rate int unsigned NULL,
ADD median_fee_value int unsigned NULL,
ADD subsidy float unsigned NULL;
ADD avg_fee INT UNSIGNED NULL,
ADD avg_fee_rate INT UNSIGNED NULL
`);
await this.$executeQuery(connection, 'ALTER TABLE blocks MODIFY `reward` BIGINT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery(connection, 'ALTER TABLE blocks MODIFY `median_fee` INT UNSIGNED NOT NULL DEFAULT "0"');
await this.$executeQuery(connection, 'ALTER TABLE blocks MODIFY `fees` INT UNSIGNED NOT NULL DEFAULT "0"');
}
connection.release();