Merge pull request #3330 from mempool/mononaut/reduce-disk-cache-frequency

Save cache to disk every 6 blocks
This commit is contained in:
softsimon 2023-03-12 21:06:19 +09:00 committed by GitHub
commit 5e4131b474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -641,7 +641,7 @@ class Blocks {
if (this.newBlockCallbacks.length) {
this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions));
}
if (!memPool.hasPriority()) {
if (!memPool.hasPriority() && (block.height % 6 === 0)) {
diskCache.$saveCacheToDisk();
}