Fix getSimilarity error on empty mempool

This commit is contained in:
Mononaut 2023-03-16 22:15:20 +09:00
parent 25aacb5046
commit b5c2073414
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -469,8 +469,10 @@ class WebsocketHandler {
}
} else if (block.extras) {
const mBlocks = mempoolBlocks.getMempoolBlocksWithTransactions();
if (mBlocks?.length && mBlocks[0].transactions) {
block.extras.similarity = Common.getSimilarity(mBlocks[0], transactions);
}
}
const removed: string[] = [];
// Update mempool to remove transactions included in the new block