mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Empty block fix.
This commit is contained in:
parent
32fdb32792
commit
c5c068a8d4
2 changed files with 3 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
||||||
"DB_DATABASE": "mempool",
|
"DB_DATABASE": "mempool",
|
||||||
"API_ENDPOINT": "/api/v1/",
|
"API_ENDPOINT": "/api/v1/",
|
||||||
"ELECTRS_POLL_RATE_MS": 2000,
|
"ELECTRS_POLL_RATE_MS": 2000,
|
||||||
"MEMPOOL_REFRESH_RATE_MS": 10000,
|
"MEMPOOL_REFRESH_RATE_MS": 2000,
|
||||||
"DEFAULT_PROJECTED_BLOCKS_AMOUNT": 3,
|
"DEFAULT_PROJECTED_BLOCKS_AMOUNT": 3,
|
||||||
"KEEP_BLOCK_AMOUNT": 24,
|
"KEEP_BLOCK_AMOUNT": 24,
|
||||||
"INITIAL_BLOCK_AMOUNT": 8,
|
"INITIAL_BLOCK_AMOUNT": 8,
|
||||||
|
|
|
@ -63,8 +63,8 @@ class Blocks {
|
||||||
console.log(`${found} of ${txIds.length} found in mempool. ${notFound} not found.`);
|
console.log(`${found} of ${txIds.length} found in mempool. ${notFound} not found.`);
|
||||||
|
|
||||||
transactions.sort((a, b) => b.feePerVsize - a.feePerVsize);
|
transactions.sort((a, b) => b.feePerVsize - a.feePerVsize);
|
||||||
block.medianFee = this.median(transactions.map((tx) => tx.feePerVsize));
|
block.medianFee = transactions.length ? this.median(transactions.map((tx) => tx.feePerVsize)) : 0;
|
||||||
block.feeRange = this.getFeesInRange(transactions, 8);
|
block.feeRange = transactions.length ? this.getFeesInRange(transactions, 8) : [];
|
||||||
|
|
||||||
this.blocks.push(block);
|
this.blocks.push(block);
|
||||||
if (this.blocks.length > config.KEEP_BLOCK_AMOUNT) {
|
if (this.blocks.length > config.KEEP_BLOCK_AMOUNT) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue