From 0f77fb88bf011604712cf37b089cd8ad45c856b7 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Fri, 21 Jul 2023 17:18:45 +0900 Subject: [PATCH] handle missing block.extras on liquid --- .../src/app/components/block/block.component.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 4be6e3aff..ce3317255 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -144,10 +144,12 @@ export class BlockComponent implements OnInit, OnDestroy { for (const block of blocks) { if (block.id === this.blockHash) { this.block = block; - block.extras.minFee = this.getMinBlockFee(block); - block.extras.maxFee = this.getMaxBlockFee(block); - if (block?.extras?.reward != undefined) { - this.fees = block.extras.reward / 100000000 - this.blockSubsidy; + if (block.extras) { + block.extras.minFee = this.getMinBlockFee(block); + block.extras.maxFee = this.getMaxBlockFee(block); + if (block?.extras?.reward != undefined) { + this.fees = block.extras.reward / 100000000 - this.blockSubsidy; + } } } else if (block.height === this.block?.height) { this.block.stale = true; @@ -246,8 +248,10 @@ export class BlockComponent implements OnInit, OnDestroy { } this.updateAuditAvailableFromBlockHeight(block.height); this.block = block; - block.extras.minFee = this.getMinBlockFee(block); - block.extras.maxFee = this.getMaxBlockFee(block); + if (block.extras) { + block.extras.minFee = this.getMinBlockFee(block); + block.extras.maxFee = this.getMaxBlockFee(block); + } this.blockHeight = block.height; this.lastBlockHeight = this.blockHeight; this.nextBlockHeight = block.height + 1;