Adding configuration for blocks and mempool blocks amount.

This commit is contained in:
softsimon
2021-07-31 17:56:10 +03:00
parent 037f472f8c
commit 1908b1a5a6
9 changed files with 23 additions and 16 deletions

View File

@@ -183,7 +183,7 @@ export class BlockchainBlocksComponent implements OnInit, OnDestroy {
}
mountEmptyBlocks() {
const emptyBlocks = [];
for (let i = 0; i < 9; i++) {
for (let i = 0; i < this.stateService.env.KEEP_BLOCKS_AMOUNT; i++) {
emptyBlocks.push({
id: '',
height: 0,

View File

@@ -144,7 +144,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
this.router.navigate([(this.network ? '/' + this.network : '') + '/mempool-block/', this.markIndex - 1]);
} else {
this.stateService.blocks$
.pipe(take(8))
.pipe(take(this.stateService.env.MEMPOOL_BLOCKS_AMOUNT))
.subscribe(([block]) => {
if (this.stateService.latestBlockHeight === block.height) {
this.router.navigate([(this.network ? '/' + this.network : '') + '/block/', block.id], { state: { data: { block } }});
@@ -275,8 +275,8 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
mountEmptyBlocks() {
const emptyBlocks = [];
const numberOfBlocks = 8;
for (let i = 0; i <= numberOfBlocks; i++) {
const numberOfBlocks = this.stateService.env.MEMPOOL_BLOCKS_AMOUNT;
for (let i = 0; i < numberOfBlocks; i++) {
emptyBlocks.push({
blockSize: 0,
blockVSize: 0,