Fix getSimilarity error on empty mempool
This commit is contained in:
		
							parent
							
								
									25aacb5046
								
							
						
					
					
						commit
						b5c2073414
					
				| @ -469,8 +469,10 @@ class WebsocketHandler { | |||||||
|       } |       } | ||||||
|     } else if (block.extras) { |     } else if (block.extras) { | ||||||
|       const mBlocks = mempoolBlocks.getMempoolBlocksWithTransactions(); |       const mBlocks = mempoolBlocks.getMempoolBlocksWithTransactions(); | ||||||
|  |       if (mBlocks?.length && mBlocks[0].transactions) { | ||||||
|         block.extras.similarity = Common.getSimilarity(mBlocks[0], transactions); |         block.extras.similarity = Common.getSimilarity(mBlocks[0], transactions); | ||||||
|       } |       } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     const removed: string[] = []; |     const removed: string[] = []; | ||||||
|     // Update mempool to remove transactions included in the new block
 |     // Update mempool to remove transactions included in the new block
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user