This commit is contained in:
softsimon
2020-07-24 14:11:49 +07:00
parent 959e2b55cb
commit 24182a6fb3
5 changed files with 21 additions and 14 deletions

View File

@@ -22,7 +22,7 @@
</tr>
<tr>
<td>Total fees</td>
<td><app-amount [satoshis]="mempoolBlock.totalFees" [digitsInfo]="'1.2-2'"></app-amount> (<app-fiat [value]="mempoolBlock.totalFees" digitsInfo="1.0-0"></app-fiat>)</td>
<td><app-amount [satoshis]="mempoolBlock.totalFees" [digitsInfo]="'1.2-2'" [noFiat]="true"></app-amount> (<app-fiat [value]="mempoolBlock.totalFees" digitsInfo="1.0-0"></app-fiat>)</td>
</tr>
<tr>
<td>Transactions</td>

View File

@@ -31,6 +31,12 @@ export class MempoolBlockComponent implements OnInit, OnDestroy {
this.mempoolBlockIndex = parseInt(params.get('id'), 10) || 0;
return this.stateService.mempoolBlocks$
.pipe(
map((blocks) => {
if (!blocks.length) {
return [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
}
return blocks;
}),
filter((mempoolBlocks) => mempoolBlocks.length > 0),
map((mempoolBlocks) => {
while (!mempoolBlocks[this.mempoolBlockIndex]) {