diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index 400649b26..3b3ce881a 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -1,3 +1,5 @@ +const config = require('../../mempool-config.json'); + import * as WebSocket from 'ws'; import * as fs from 'fs'; import { Block, TransactionExtended, Statistic } from '../interfaces'; @@ -68,7 +70,7 @@ class WebsocketHandler { client.send(JSON.stringify({ 'mempoolInfo': memPool.getMempoolInfo(), 'vBytesPerSecond': memPool.getVBytesPerSecond(), - 'blocks': _blocks, + 'blocks': _blocks.slice(config.INITIAL_BLOCK_AMOUNT), 'conversions': fiatConversion.getTickers()['BTCUSD'], 'mempool-blocks': mempoolBlocks.getMempoolBlocks(), 'git-commit': this.latestGitCommitHash diff --git a/frontend/src/app/components/block/block.component.html b/frontend/src/app/components/block/block.component.html index 89b1769e6..be1d1f4d2 100644 --- a/frontend/src/app/components/block/block.component.html +++ b/frontend/src/app/components/block/block.component.html @@ -48,11 +48,11 @@ Hash {{ block.id | shortenString : 16 }} - - Previous Block - {{ block.previousblockhash | shortenString : 16 }} + + Median fee + ~{{ block.medianFee | ceil }} sats/vB () - + Total fees {{ fees | number: '1.2-2' }} BTC () diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index e2fdd31ec..d415dab34 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -89,7 +89,7 @@ export class BlockComponent implements OnInit { this.transactions = null; this.electrsApiService.getBlockTransactions$(hash) .subscribe((transactions: any) => { - if (!this.fees) { + if (this.fees === undefined) { this.fees = transactions[0].vout.reduce((acc: number, curr: Vout) => acc + curr.value, 0) / 100000000 - this.blockSubsidy; } this.transactions = transactions; diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html index 13570c2f3..0fa834ffd 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html @@ -7,7 +7,7 @@
- ~{{ block.medianFee | ceil }} sat/vB + ~{{ block.medianFee | ceil }} sats/vB
{{ block.size | bytes: 2 }}
{{ block.tx_count }} transactions
diff --git a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html index 0688e91b4..da3661576 100644 --- a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html +++ b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.html @@ -4,7 +4,7 @@
- ~{{ projectedBlock.medianFee | ceil }} sat/vB + ~{{ projectedBlock.medianFee | ceil }} sats/vB
{{ projectedBlock.blockSize | bytes: 2 }}
{{ projectedBlock.nTx }} transactions
diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 0d2852cc0..11771587c 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -45,12 +45,12 @@ - Fees + Fee {{ tx.fee | number }} sats () - Fees per vByte - {{ tx.fee / (tx.weight / 4) | number : '1.2-2' }} sat/vB + Fee per vByte + {{ tx.fee / (tx.weight / 4) | number : '1.2-2' }} sats/vB @@ -85,7 +85,7 @@ Fees per vByte - {{ tx.fee / (tx.weight / 4) | number : '1.2-2' }} sat/vB + {{ tx.fee / (tx.weight / 4) | number : '1.2-2' }} sats/vB