fix: blocksfull variable.

This commit is contained in:
Miguel Medeiros 2021-11-15 16:38:28 -03:00
parent 0639ce9b07
commit 3bab50a43b
No known key found for this signature in database
GPG Key ID: 819EDEE4673F3EBB

View File

@ -89,15 +89,17 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
}
});
let blocks = mempoolBlocks;
if (!mempoolBlocks.length) {
blocks = [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
const emptyBlock = [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(emptyBlock);
} else {
const stringifiedBlocks = JSON.stringify(mempoolBlocks);
this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
}
this.mempoolBlocksFull = blocks;
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(blocks);
this.updateMempoolBlockStyles();
this.calculateTransactionPosition();
return blocks;
return this.mempoolBlocks;
})
);