Empty block fix.

This commit is contained in:
Simon Lindh 2020-02-24 10:58:52 +07:00 committed by wiz
parent 32fdb32792
commit c5c068a8d4
No known key found for this signature in database
GPG key ID: A394E332255A6173
2 changed files with 3 additions and 3 deletions

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,

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) {