Fix error handling in BlockDownloaderImpl
`lastError` inside the `BlockDownloaderImpl` was set even when downloading task was canceled. And because it was canceled the `lastError` has never been read by CBP before the next sync. And when next sync was started it was immediately failed because of cancelation error stored in `lastError`.
This commit is contained in:
parent
c3335db54d
commit
9f333170c7
|
@ -139,10 +139,10 @@ actor BlockDownloaderImpl {
|
|||
isDownloading = false
|
||||
}
|
||||
} catch {
|
||||
lastError = error
|
||||
if Task.isCancelled {
|
||||
logger.debug("Blocks downloading canceled.")
|
||||
} else {
|
||||
lastError = error
|
||||
logger.error("Blocks downloading failed: \(error)")
|
||||
}
|
||||
isDownloading = false
|
||||
|
|
Loading…
Reference in New Issue