[blocks] save pools-v2.json hash in blocks table

This commit is contained in:
nymkappa
2024-11-29 16:04:54 +01:00
parent 14e49126c3
commit c8e967cc0c
3 changed files with 22 additions and 23 deletions

View File

@@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
import { RowDataPacket } from 'mysql2';
class DatabaseMigration {
private static currentVersion = 91;
private static currentVersion = 92;
private queryTimeout = 3600_000;
private statisticsAddedIndexed = false;
private uniqueLogs: string[] = [];
@@ -775,6 +775,12 @@ class DatabaseMigration {
await this.$executeQuery('ALTER TABLE `blocks_audits` ADD INDEX `time` (`time`)');
await this.updateToSchemaVersion(91);
}
// blocks pools-v2.json hash
if (databaseSchemaVersion < 92) {
await this.$executeQuery('ALTER TABLE `blocks` ADD definition_hash varchar(255) NOT NULL DEFAULT "5f32a67401929169f225f5db43c9efa795d1b159"');
await this.updateToSchemaVersion(92);
}
}
/**

View File

@@ -19,15 +19,6 @@ class PoolsParser {
'addresses': '[]',
'slug': 'unknown'
};
private uniqueLogs: string[] = [];
private uniqueLog(loggerFunction: any, msg: string): void {
if (this.uniqueLogs.includes(msg)) {
return;
}
this.uniqueLogs.push(msg);
loggerFunction(msg);
}
public setMiningPools(pools): void {
for (const pool of pools) {