Display fees correctly for Liquid blocks.
This commit is contained in:
parent
279b79b9b1
commit
22813a09e8
@ -98,7 +98,7 @@ class Blocks {
|
|||||||
vin: [{
|
vin: [{
|
||||||
scriptsig: tx.vin[0].scriptsig
|
scriptsig: tx.vin[0].scriptsig
|
||||||
}],
|
}],
|
||||||
vout: tx.vout.map((vout) => ({ scriptpubkey_address: vout.scriptpubkey_address }))
|
vout: tx.vout.map((vout) => ({ scriptpubkey_address: vout.scriptpubkey_address, value: vout.value }))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ interface VinStrippedToScriptsig {
|
|||||||
|
|
||||||
interface VoutStrippedToScriptPubkey {
|
interface VoutStrippedToScriptPubkey {
|
||||||
scriptpubkey_address: string | undefined;
|
scriptpubkey_address: string | undefined;
|
||||||
|
value: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TransactionExtended extends Transaction {
|
export interface TransactionExtended extends Transaction {
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
<td>Total fees</td>
|
<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><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>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr *ngIf="network !== 'liquid'">
|
||||||
<td>Subsidy + fees:</td>
|
<td>Subsidy + fees:</td>
|
||||||
<td>
|
<td>
|
||||||
<app-amount [satoshis]="(blockSubsidy + fees) * 100000000" digitsInfo="1.2-2" [noFiat]="true"></app-amount> (<app-fiat [value]="(blockSubsidy + fees) * 100000000" digitsInfo="1.0-0"></app-fiat>)
|
<app-amount [satoshis]="(blockSubsidy + fees) * 100000000" digitsInfo="1.2-2" [noFiat]="true"></app-amount> (<app-fiat [value]="(blockSubsidy + fees) * 100000000" digitsInfo="1.0-0"></app-fiat>)
|
||||||
|
@ -108,7 +108,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.subscribe((transactions: Transaction[]) => {
|
.subscribe((transactions: Transaction[]) => {
|
||||||
if (this.fees === undefined && transactions[0] && this.network !== 'liquid') {
|
if (this.fees === undefined && transactions[0]) {
|
||||||
this.fees = transactions[0].vout.reduce((acc: number, curr: Vout) => acc + curr.value, 0) / 100000000 - this.blockSubsidy;
|
this.fees = transactions[0].vout.reduce((acc: number, curr: Vout) => acc + curr.value, 0) / 100000000 - this.blockSubsidy;
|
||||||
}
|
}
|
||||||
this.transactions = transactions;
|
this.transactions = transactions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user