FIX: processor crashes when lightwalletd has not caught up with latest height

This commit is contained in:
Francisco Gindre 2020-03-12 18:58:23 -03:00
parent 2d34615c6d
commit 8f415d71ce
1 changed files with 4 additions and 0 deletions

View File

@ -293,6 +293,10 @@ public class CompactBlockProcessor {
if self.latestBlockHeight == latestDownloadedBlockHeight {
self.processingFinished(height: blockHeight)
} else if self.latestBlockHeight < latestDownloadedBlockHeight {
// Lightwalletd might be syncing
LoggerProxy.info("Lightwalletd might be syncing: latest downloaded block height is: \(latestDownloadedBlockHeight) while latest blockheight is reported at: \(blockHeight)")
self.processingFinished(height: latestDownloadedBlockHeight)
} else {
self.processNewBlocks(range: self.nextBatchBlockRange(latestHeight: self.latestBlockHeight, latestDownloadedHeight: latestDownloadedBlockHeight))
}