[#1011] Improve end of the sync process

- added check for mined blocks, if yes, the next batch is called
This commit is contained in:
Lukas Korba 2023-05-04 10:11:57 +02:00
parent 505ac6a26c
commit 4197436668
1 changed files with 2 additions and 1 deletions

View File

@ -775,7 +775,8 @@ actor CompactBlockProcessor {
try await clearCompactBlockCache()
if !Task.isCancelled {
await processBatchFinished(height: anyActionExecuted ? ranges.latestBlockHeight : nil)
let newBlocksMined = await ranges.latestBlockHeight < latestBlocksDataProvider.latestBlockHeight
await processBatchFinished(height: (anyActionExecuted && !newBlocksMined) ? ranges.latestBlockHeight : nil)
}
} catch {
logger.error("Sync failed with error: \(error)")