diff --git a/frontend/mempool-frontend-config.sample.json b/frontend/mempool-frontend-config.sample.json index 8b0d79471..5c0f92acf 100644 --- a/frontend/mempool-frontend-config.sample.json +++ b/frontend/mempool-frontend-config.sample.json @@ -17,6 +17,8 @@ "LIQUID_WEBSITE_URL": "https://liquid.network", "BISQ_WEBSITE_URL": "https://bisq.markets", "MINING_DASHBOARD": true, - "BLOCK_AUDIT_START_HEIGHT": 0, + "MAINNET_BLOCK_AUDIT_START_HEIGHT": 0, + "TESTNET_BLOCK_AUDIT_START_HEIGHT": 0, + "SIGNET_BLOCK_AUDIT_START_HEIGHT": 0, "LIGHTNING": false } diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 3523f9a06..f861e9b7c 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -154,9 +154,7 @@ export class BlockComponent implements OnInit, OnDestroy { if (history.state.data && history.state.data.block) { this.blockHeight = history.state.data.block.height; - if (this.blockHeight < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) { - this.auditDataMissing = true; - } + this.updateAuditDataMissingFromBlockHeight(this.blockHeight); return of(history.state.data.block); } else { this.isLoadingBlock = true; @@ -218,9 +216,7 @@ export class BlockComponent implements OnInit, OnDestroy { this.apiService.getBlockAudit$(block.previousblockhash); }, 100); } - if (block.height < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) { - this.auditDataMissing = true; - } + this.updateAuditDataMissingFromBlockHeight(block.height); this.block = block; this.blockHeight = block.height; this.lastBlockHeight = this.blockHeight; @@ -590,4 +586,23 @@ export class BlockComponent implements OnInit, OnDestroy { this.hoverTx = null; } } + + updateAuditDataMissingFromBlockHeight(blockHeight: number): void { + switch (this.stateService.network) { + case 'testnet': + if (blockHeight < this.stateService.env.TESTNET_BLOCK_AUDIT_START_HEIGHT) { + this.auditDataMissing = true; + } + break; + case 'signet': + if (blockHeight < this.stateService.env.SIGNET_BLOCK_AUDIT_START_HEIGHT) { + this.auditDataMissing = true; + } + break; + default: + if (blockHeight < this.stateService.env.MAINNET_BLOCK_AUDIT_START_HEIGHT) { + this.auditDataMissing = true; + } + } + } } \ No newline at end of file diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index eff2f2c1d..8a87b97e5 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -39,7 +39,9 @@ export interface Env { BISQ_WEBSITE_URL: string; MINING_DASHBOARD: boolean; LIGHTNING: boolean; - BLOCK_AUDIT_START_HEIGHT: number; + MAINNET_BLOCK_AUDIT_START_HEIGHT: number; + TESTNET_BLOCK_AUDIT_START_HEIGHT: number; + SIGNET_BLOCK_AUDIT_START_HEIGHT: number; } const defaultEnv: Env = { @@ -65,7 +67,9 @@ const defaultEnv: Env = { 'BISQ_WEBSITE_URL': 'https://bisq.markets', 'MINING_DASHBOARD': true, 'LIGHTNING': false, - 'BLOCK_AUDIT_START_HEIGHT': 0, + 'MAINNET_BLOCK_AUDIT_START_HEIGHT': 0, + 'TESTNET_BLOCK_AUDIT_START_HEIGHT': 0, + 'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0, }; @Injectable({