Empty block fix.

This commit is contained in:
Simon Lindh authored and wiz committed 2020-02-26 03:35:46 +09:00
1 parent 32fdb32792
commit c5c068a8d4
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
"DB_DATABASE": "mempool",
"API_ENDPOINT": "/api/v1/",
"ELECTRS_POLL_RATE_MS": 2000,
"MEMPOOL_REFRESH_RATE_MS": 10000,
"MEMPOOL_REFRESH_RATE_MS": 2000,
"DEFAULT_PROJECTED_BLOCKS_AMOUNT": 3,
"KEEP_BLOCK_AMOUNT": 24,
"INITIAL_BLOCK_AMOUNT": 8,
+2 -2
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) {