delay writing disk cache until block handler completes

This commit is contained in:
Mononaut
2023-05-01 14:30:30 -06:00
parent 2773bbfd00
commit bb1ee90b0b
3 changed files with 39 additions and 0 deletions

View File

@@ -520,6 +520,8 @@ class Blocks {
}
public async $updateBlocks() {
diskCache.lock();
let fastForwarded = false;
const blockHeightTip = await bitcoinApi.$getBlockHeightTip();
@@ -658,6 +660,8 @@ class Blocks {
// wait for pending async callbacks to finish
await Promise.all(callbackPromises);
}
diskCache.unlock();
}
/**