Only save cache on new block when in sync.

This commit is contained in:
softsimon
2021-01-22 23:20:39 +07:00
parent d3a6dc8856
commit ccec935193

View File

@@ -116,7 +116,9 @@ class Blocks {
if (this.newBlockCallbacks.length) { if (this.newBlockCallbacks.length) {
this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions)); this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions));
} }
diskCache.$saveCacheToDisk(); if (memPool.isInSync()) {
diskCache.$saveCacheToDisk();
}
} }
} }