mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
Add min_fee_rate columns to blocks table
This commit is contained in:
parent
5e2008bc4b
commit
22f4172ec3
1 changed files with 18 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository';
|
|||
import { RowDataPacket } from 'mysql2';
|
||||
|
||||
class DatabaseMigration {
|
||||
private static currentVersion = 111;
|
||||
private static currentVersion = 112;
|
||||
private queryTimeout = 3600_000;
|
||||
private statisticsAddedIndexed = false;
|
||||
private uniqueLogs: string[] = [];
|
||||
|
|
@ -1255,6 +1255,23 @@ class DatabaseMigration {
|
|||
await this.$executeQuery('ALTER TABLE `compact_cpfp_clusters` ADD template_algo TINYINT UNSIGNED NOT NULL DEFAULT 0');
|
||||
await this.updateToSchemaVersion(111);
|
||||
}
|
||||
|
||||
if (databaseSchemaVersion < 112 && isBitcoin === true) {
|
||||
// Per-block minimum fee-merit effective fee rate (issue #6639). The computation
|
||||
// version handles algorithm changes; the acceleration-set snapshot lets the
|
||||
// bounded pull sweep detect late-arriving accelerations without producer-side
|
||||
// writes.
|
||||
await this.$executeQuery(`
|
||||
ALTER TABLE blocks
|
||||
ADD min_fee_rate DOUBLE UNSIGNED NULL DEFAULT NULL,
|
||||
ADD min_fee_rate_version TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
ADD min_fee_rate_acceleration_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
ADD min_fee_rate_acceleration_fingerprint CHAR(64) NOT NULL DEFAULT '',
|
||||
ADD min_fee_rate_computed_at TIMESTAMP NULL DEFAULT NULL,
|
||||
ADD INDEX min_fee_rate_backfill (stale, min_fee_rate_version, min_fee_rate_computed_at)
|
||||
`);
|
||||
await this.updateToSchemaVersion(112);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue