parent
							
								
									6e93ef68fe
								
							
						
					
					
						commit
						822c840e54
					
				@ -75,7 +75,8 @@ class MempoolBlocks {
 | 
				
			|||||||
    let blockSize = 0;
 | 
					    let blockSize = 0;
 | 
				
			||||||
    let transactions: TransactionExtended[] = [];
 | 
					    let transactions: TransactionExtended[] = [];
 | 
				
			||||||
    transactionsSorted.forEach((tx) => {
 | 
					    transactionsSorted.forEach((tx) => {
 | 
				
			||||||
      if (blockWeight + tx.weight <= config.MEMPOOL.BLOCK_WEIGHT_UNITS || mempoolBlocks.length === config.MEMPOOL.MEMPOOL_BLOCKS_AMOUNT) {
 | 
					      if (blockWeight + tx.weight <= config.MEMPOOL.BLOCK_WEIGHT_UNITS
 | 
				
			||||||
 | 
					        || mempoolBlocks.length === config.MEMPOOL.MEMPOOL_BLOCKS_AMOUNT - 1) {
 | 
				
			||||||
        blockWeight += tx.weight;
 | 
					        blockWeight += tx.weight;
 | 
				
			||||||
        blockSize += tx.size;
 | 
					        blockSize += tx.size;
 | 
				
			||||||
        transactions.push(tx);
 | 
					        transactions.push(tx);
 | 
				
			||||||
 | 
				
			|||||||
@ -184,7 +184,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  reduceMempoolBlocksToFitScreen(blocks: MempoolBlock[]): MempoolBlock[] {
 | 
					  reduceMempoolBlocksToFitScreen(blocks: MempoolBlock[]): MempoolBlock[] {
 | 
				
			||||||
    const blocksAmount = Math.max(2, Math.floor(window.innerWidth / 2 / (this.blockWidth + this.blockPadding)));
 | 
					    const blocksAmount = Math.min(this.stateService.env.MEMPOOL_BLOCKS_AMOUNT, Math.floor(window.innerWidth / 2 / (this.blockWidth + this.blockPadding)));
 | 
				
			||||||
    while (blocks.length > blocksAmount) {
 | 
					    while (blocks.length > blocksAmount) {
 | 
				
			||||||
      const block = blocks.pop();
 | 
					      const block = blocks.pop();
 | 
				
			||||||
      const lastBlock = blocks[blocks.length - 1];
 | 
					      const lastBlock = blocks[blocks.length - 1];
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user