delay writing disk cache until block handler completes
This commit is contained in:
@@ -533,6 +533,8 @@ class Blocks {
|
||||
// warn if this run stalls the main loop for more than 2 minutes
|
||||
const timer = this.startTimer();
|
||||
|
||||
diskCache.lock();
|
||||
|
||||
let fastForwarded = false;
|
||||
const blockHeightTip = await bitcoinApi.$getBlockHeightTip();
|
||||
this.updateTimerProgress(timer, 'got block height tip');
|
||||
@@ -697,6 +699,8 @@ class Blocks {
|
||||
this.updateTimerProgress(timer, `async callbacks completed for ${this.currentBlockHeight}`);
|
||||
}
|
||||
|
||||
diskCache.unlock();
|
||||
|
||||
this.clearTimer(timer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user