Fixes to block reward display on Liquid.

This commit is contained in:
softsimon 2020-07-23 12:10:22 +07:00
parent b6b9001406
commit 23f5e229c9
No known key found for this signature in database
GPG key ID: 488D7DCFB5A430D7
3 changed files with 9 additions and 4 deletions

View file

@ -98,7 +98,9 @@ class Blocks {
vin: [{
scriptsig: tx.vin[0].scriptsig
}],
vout: tx.vout.map((vout) => ({ scriptpubkey_address: vout.scriptpubkey_address, value: vout.value }))
vout: tx.vout
.map((vout) => ({ scriptpubkey_address: vout.scriptpubkey_address, value: vout.value }))
.filter((vout) => vout.value)
};
}
}

View file

@ -48,7 +48,10 @@
<ng-template [ngIf]="fees !== undefined" [ngIfElse]="loadingFees">
<tr>
<td>Total fees</td>
<td><app-amount [satoshis]="fees * 100000000" digitsInfo="1.2-2" [noFiat]="true"></app-amount> (<app-fiat [value]="fees * 100000000" digitsInfo="1.0-0"></app-fiat>)</td>
<td *ngIf="network !== 'liquid'; else liquidTotalFees"><app-amount [satoshis]="fees * 100000000" digitsInfo="1.2-2" [noFiat]="true"></app-amount> (<app-fiat [value]="fees * 100000000" digitsInfo="1.0-0"></app-fiat>)</td>
<ng-template #liquidTotalFees>
<td>{{ fees | number }} L-sat (<app-fiat [value]="fees * 100000000" digitsInfo="1.2-2"></app-fiat>)</td>
</ng-template>
</tr>
<tr *ngIf="network !== 'liquid'">
<td>Subsidy + fees:</td>
@ -62,7 +65,7 @@
<td>Total fees</td>
<td style="width: 75%;"><span class="skeleton-loader"></span></td>
</tr>
<tr>
<tr *ngIf="network !== 'liquid'">
<td>Subsidy + fees:</td>
<td><span class="skeleton-loader"></span></td>
</tr>

View file

@ -98,7 +98,7 @@ export class BlockComponent implements OnInit, OnDestroy {
this.coinbaseTx = block.coinbaseTx;
}
this.setBlockSubsidy();
if (block.reward) {
if (block.reward !== undefined) {
this.fees = block.reward / 100000000 - this.blockSubsidy;
}
this.stateService.markBlock$.next({ blockHeight: this.blockHeight });