Merge pull request #4985 from mempool/mononaut/fix-audit-bug

Fix audit blockIndex increment bug
This commit is contained in:
softsimon 2024-04-19 00:13:48 +07:00 committed by GitHub
commit f86b6ac3de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,10 +75,6 @@ class Audit {
let failures = 0;
let blockIndex = 1;
while (projectedBlocks[blockIndex] && failures < 500) {
if (index >= projectedBlocks[blockIndex].transactionIds.length) {
index = 0;
blockIndex++;
}
const txid = projectedBlocks[blockIndex].transactionIds[index];
const tx = mempool[txid];
if (tx) {
@ -102,6 +98,10 @@ class Audit {
logger.warn('projected transaction missing from mempool cache');
}
index++;
if (index >= projectedBlocks[blockIndex].transactionIds.length) {
index = 0;
blockIndex++;
}
}
// mark unexpected transactions in the mined block as 'added'