Index asciiScriptSig and display it in /mining/blocks

This commit is contained in:
nymkappa
2022-03-15 23:33:51 +01:00
parent 9c60c7ba79
commit 94dbec46cf
8 changed files with 59 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ import logger from '../logger';
const sleep = (ms: number) => new Promise(res => setTimeout(res, ms));
class DatabaseMigration {
private static currentVersion = 14;
private static currentVersion = 15;
private queryTimeout = 120000;
private statisticsAddedIndexed = false;
@@ -175,6 +175,12 @@ class DatabaseMigration {
await this.$executeQuery(connection, 'ALTER TABLE `hashrates` MODIFY `pool_id` SMALLINT UNSIGNED NOT NULL DEFAULT "0"');
}
if (databaseSchemaVersion < 15 && isBitcoin === true) {
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` MODIFY `coinbase_raw` TEXT COLLATE "utf8mb4_general_ci" NULL ');
}
connection.release();
} catch (e) {
connection.release();