mirror of
https://github.com/mempool/mempool.git
synced 2025-09-26 19:57:02 +02:00
db migration to reindex blocks since first annex tx
This commit is contained in:
@@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
|
||||
import { RowDataPacket } from 'mysql2';
|
||||
|
||||
class DatabaseMigration {
|
||||
private static currentVersion = 97;
|
||||
private static currentVersion = 98;
|
||||
private queryTimeout = 3600_000;
|
||||
private statisticsAddedIndexed = false;
|
||||
private uniqueLogs: string[] = [];
|
||||
@@ -1146,6 +1146,14 @@ class DatabaseMigration {
|
||||
await this.$executeQuery(`ALTER TABLE blocks MODIFY COLUMN definition_hash varchar(255) NULL DEFAULT "${poolJsonSha}"`);
|
||||
await this.updateToSchemaVersion(97);
|
||||
}
|
||||
|
||||
// reindex mainnet Goggles flags for mined block templates above height 896070
|
||||
// (since the first annex transaction at height 896071)
|
||||
// (safe to make this conditional on the network since it doesn't change the database schema)
|
||||
if (databaseSchemaVersion < 98 && config.MEMPOOL.NETWORK === 'mainnet') {
|
||||
await this.$executeQuery('UPDATE blocks_summaries SET version = 0 WHERE height >= 896070;');
|
||||
await this.updateToSchemaVersion(98);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user