Reinstate the mempool loop time limit

This commit is contained in:
softsimon 2023-06-16 20:42:31 +02:00
parent 2faeb1071e
commit 176f5e1377
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -186,6 +186,12 @@ class Mempool {
loadingIndicators.setProgress('mempool', progress);
loggerTimer = new Date().getTime() / 1000;
}
// Break and restart mempool loop if we spend too much time processing
// new transactions that may lead to falling behind on block height
if (this.inSync && (new Date().getTime()) - start > 10_000) {
logger.debug('Breaking mempool loop because the 10s time limit exceeded.');
break;
}
}
// Reset esplora 404 counter and log a warning if needed