Empty block fix.

This commit is contained in:
Simon Lindh
2020-02-24 10:58:52 +07:00
committed by wiz
parent 808aa27be7
commit 76fd441e07
2 changed files with 3 additions and 3 deletions

View File

@@ -63,8 +63,8 @@ class Blocks {
console.log(`${found} of ${txIds.length} found in mempool. ${notFound} not found.`);
transactions.sort((a, b) => b.feePerVsize - a.feePerVsize);
block.medianFee = this.median(transactions.map((tx) => tx.feePerVsize));
block.feeRange = this.getFeesInRange(transactions, 8);
block.medianFee = transactions.length ? this.median(transactions.map((tx) => tx.feePerVsize)) : 0;
block.feeRange = transactions.length ? this.getFeesInRange(transactions, 8) : [];
this.blocks.push(block);
if (this.blocks.length > config.KEEP_BLOCK_AMOUNT) {