Fix missing fees in liquid block tooltips
This commit is contained in:
parent
ec8a46ede6
commit
ed46232b83
@ -143,7 +143,10 @@ class Blocks {
|
|||||||
* @returns BlockSummary
|
* @returns BlockSummary
|
||||||
*/
|
*/
|
||||||
public summarizeBlock(block: IBitcoinApi.VerboseBlock): BlockSummary {
|
public summarizeBlock(block: IBitcoinApi.VerboseBlock): BlockSummary {
|
||||||
const stripped = block.tx.map((tx) => {
|
if (Common.isLiquid()) {
|
||||||
|
block = this.convertLiquidFees(block);
|
||||||
|
}
|
||||||
|
const stripped = block.tx.map((tx: IBitcoinApi.VerboseTransaction) => {
|
||||||
return {
|
return {
|
||||||
txid: tx.txid,
|
txid: tx.txid,
|
||||||
vsize: tx.weight / 4,
|
vsize: tx.weight / 4,
|
||||||
@ -158,6 +161,13 @@ class Blocks {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private convertLiquidFees(block: IBitcoinApi.VerboseBlock): IBitcoinApi.VerboseBlock {
|
||||||
|
block.tx.forEach(tx => {
|
||||||
|
tx.fee = Object.values(tx.fee || {}).reduce((total, output) => total + output, 0);
|
||||||
|
});
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a block with additional data (reward, coinbase, fees...)
|
* Return a block with additional data (reward, coinbase, fees...)
|
||||||
* @param block
|
* @param block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user