parent
							
								
									6ad4e655ea
								
							
						
					
					
						commit
						15a0644bd1
					
				@ -76,10 +76,18 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
      fromEvent(window, 'resize')
 | 
					      fromEvent(window, 'resize')
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    .pipe(
 | 
					    .pipe(
 | 
				
			||||||
        switchMap(() => combineLatest([
 | 
					      switchMap(() => combineLatest([
 | 
				
			||||||
          this.stateService.blocks$.pipe(map(([block]) => block)),
 | 
					        this.stateService.blocks$.pipe(map(([block]) => block)),
 | 
				
			||||||
          this.stateService.mempoolBlocks$
 | 
					        this.stateService.mempoolBlocks$
 | 
				
			||||||
        ])),
 | 
					          .pipe(
 | 
				
			||||||
 | 
					            map((mempoolBlocks) => {
 | 
				
			||||||
 | 
					              if (!mempoolBlocks.length) {
 | 
				
			||||||
 | 
					                return [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					              return mempoolBlocks;
 | 
				
			||||||
 | 
					            }),
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
 | 
					      ])),
 | 
				
			||||||
        map(([lastBlock, mempoolBlocks]) => {
 | 
					        map(([lastBlock, mempoolBlocks]) => {
 | 
				
			||||||
          mempoolBlocks.forEach((block, i) => {
 | 
					          mempoolBlocks.forEach((block, i) => {
 | 
				
			||||||
            block.index = this.blockIndex + i;
 | 
					            block.index = this.blockIndex + i;
 | 
				
			||||||
@ -89,14 +97,10 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
          });
 | 
					          });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          if (!mempoolBlocks.length) {
 | 
					          const stringifiedBlocks = JSON.stringify(mempoolBlocks);
 | 
				
			||||||
            const emptyBlock = [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
 | 
					          this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
 | 
				
			||||||
            this.mempoolBlocks = emptyBlock;
 | 
					          this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
 | 
				
			||||||
          } else {
 | 
					
 | 
				
			||||||
            const stringifiedBlocks = JSON.stringify(mempoolBlocks);
 | 
					 | 
				
			||||||
            this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
 | 
					 | 
				
			||||||
            this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          this.updateMempoolBlockStyles();
 | 
					          this.updateMempoolBlockStyles();
 | 
				
			||||||
          this.calculateTransactionPosition();
 | 
					          this.calculateTransactionPosition();
 | 
				
			||||||
          return this.mempoolBlocks;
 | 
					          return this.mempoolBlocks;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user