From e82c89a9858390b0fb51a6174b5c80620aff863b Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 22 Jan 2021 23:20:39 +0700 Subject: [PATCH] Only save cache on new block when in sync. --- backend/src/api/blocks.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index 5f4733956..bee53db9c 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -116,7 +116,9 @@ class Blocks { if (this.newBlockCallbacks.length) { this.newBlockCallbacks.forEach((cb) => cb(blockExtended, txIds, transactions)); } - diskCache.$saveCacheToDisk(); + if (memPool.isInSync()) { + diskCache.$saveCacheToDisk(); + } } }