Only save cache on new block when in sync.

This commit is contained in:
softsimon 2021-01-22 23:20:39 +07:00
parent 494119d119
commit e82c89a985
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -116,9 +116,11 @@ class Blocks {
if (this.newBlockCallbacks.length) {
this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions));
}
if (memPool.isInSync()) {
diskCache.$saveCacheToDisk();
}
}
}
public getLastDifficultyAdjustmentTime(): number {
return this.lastDifficultyAdjustmentTime;