Actually use the past 8 blocks for reward stats

This commit is contained in:
nymkappa 2022-03-07 17:16:26 +01:00
parent beae88778b
commit 8837b8c882
No known key found for this signature in database
GPG key ID: E155910B16E8BD04

View file

@ -31,7 +31,7 @@ export class MiningDashboardComponent implements OnInit {
ngOnInit(): void {
this.$rewardStats = this.stateService.blocks$.pipe(
map(([block]) => {
this.blocks.push(block);
this.blocks.unshift(block);
this.blocks = this.blocks.slice(0, 8);
const totalTx = this.blocks.reduce((acc, block) => acc + block.tx_count, 0);
const totalFee = this.blocks.reduce((acc, block) => acc + block.extras?.totalFees ?? 0, 0);