fix null coinbase fees in block summary

This commit is contained in:
Mononaut 2023-08-01 17:33:03 +09:00
parent 22e57ae95c
commit 543357f1db
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
2 changed files with 3 additions and 3 deletions

View File

@ -701,7 +701,7 @@ class Blocks {
// fill in missing transaction fee data from verboseBlock
for (let i = 0; i < transactions.length; i++) {
if (!transactions[i].fee && transactions[i].txid === verboseBlock.tx[i].txid) {
transactions[i].fee = verboseBlock.tx[i].fee * 100_000_000;
transactions[i].fee = (verboseBlock.tx[i].fee * 100_000_000) || 0;
}
}
@ -941,7 +941,7 @@ class Blocks {
transactions: cpfpSummary.transactions.map(tx => {
return {
txid: tx.txid,
fee: tx.fee,
fee: tx.fee || 0,
vsize: tx.vsize,
value: Math.round(tx.vout.reduce((acc, vout) => acc + (vout.value ? vout.value : 0), 0)),
rate: tx.effectiveFeePerVsize

View File

@ -108,7 +108,7 @@ export class Common {
static stripTransaction(tx: TransactionExtended): TransactionStripped {
return {
txid: tx.txid,
fee: tx.fee,
fee: tx.fee || 0,
vsize: tx.weight / 4,
value: tx.vout.reduce((acc, vout) => acc + (vout.value ? vout.value : 0), 0),
rate: tx.effectiveFeePerVsize,