don't override start() method

This commit is contained in:
Francisco Gindre 2021-06-14 20:25:01 -03:00
parent 392b4ee0d4
commit 7f0e431f4d
6 changed files with 9 additions and 9 deletions

View File

@ -30,6 +30,7 @@ class CompactBlockDownloadOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
do {
try downloader.downloadBlockRange(range)
} catch {
@ -78,6 +79,7 @@ class CompactBlockStreamDownloadOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
do {
if self.targetHeight == nil {
@ -178,6 +180,7 @@ class CompactBlockBatchDownloadOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
do {
guard startHeight > ZcashSDK.SAPLING_ACTIVATION_HEIGHT else {

View File

@ -49,7 +49,7 @@ class CompactBlockEnhancementOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
// fetch transactions
do {

View File

@ -32,6 +32,7 @@ class CompactBlockScanningOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
guard self.rustBackend.scanBlocks(dbCache: self.cacheDb, dbData: self.dataDb, limit: limit) else {
self.error = self.rustBackend.lastError() ?? ZcashOperationError.unknown
LoggerProxy.debug("block scanning failed with error: \(String(describing: self.error))")
@ -134,6 +135,7 @@ class CompactBlockBatchScanningOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
do {
if batchSize == 0 {
let scanStartTime = Date()

View File

@ -35,6 +35,7 @@ class CompactBlockValidationOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
let result = self.rustBackend.validateCombinedChain(dbCache: cacheDb, dbData: dataDb)
switch result {
case 0:

View File

@ -41,8 +41,7 @@ class FetchUnspentTxOutputsOperation: ZcashOperation {
cancel()
return
}
self.startedHandler?()
do {
let tAddresses = try accountRepository.getAll().map({ $0.transparentAddress })
do {

View File

@ -38,12 +38,7 @@ class ZcashOperation: Operation {
self.handlerDispatchQueue = completionDispatchQueue
}
override func start() {
LoggerProxy.debug("\(self) started")
super.start()
guard !shouldCancel() else { return }
startedHandler?()
}
func shouldCancel() -> Bool {
self.error != nil || isCancelled || dependencyCancelled()