diff --git a/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift b/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift index 89c2e756..2961953b 100644 --- a/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift +++ b/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift @@ -34,7 +34,7 @@ extension TxResubmissionAction: Action { do { logger.info("TxResubmissionAction check started at \(latestBlockHeight) height.") let transactions = try await transactionRepository.findForResubmission(upTo: latestBlockHeight) - + // no candidates, update the time and continue with the next action if transactions.isEmpty { latestResolvedTime = Date().timeIntervalSince1970 diff --git a/Sources/ZcashLightClientKit/DAO/TransactionDao.swift b/Sources/ZcashLightClientKit/DAO/TransactionDao.swift index fd6c0e8d..dfbc435b 100644 --- a/Sources/ZcashLightClientKit/DAO/TransactionDao.swift +++ b/Sources/ZcashLightClientKit/DAO/TransactionDao.swift @@ -110,7 +110,6 @@ class TransactionSQLDAO: TransactionRepository { func findForResubmission(upTo: BlockHeight) async throws -> [ZcashTransaction.Overview] { let query = transactionsView - .order((ZcashTransaction.Overview.Column.minedHeight ?? BlockHeight.max).desc) .filter( ZcashTransaction.Overview.Column.minedHeight == nil && ZcashTransaction.Overview.Column.expiryHeight > upTo diff --git a/docs/cbp_state_machine.puml b/docs/cbp_state_machine.puml index de33557c..7f4cb2b9 100644 --- a/docs/cbp_state_machine.puml +++ b/docs/cbp_state_machine.puml @@ -26,7 +26,13 @@ updateChainTip -[#green,bold]-> download : Processing of scan range continues processSuggestedScanRanges : ProcessSuggestedScanRangesAction processSuggestedScanRanges -[#green,bold]-> download : Scan range available to process -processSuggestedScanRanges -[#green,bold]-> finished : Scan ranges FULLY processed +processSuggestedScanRanges -[#green,bold]-> txResubmissionA : Scan ranges FULLY processed + +txResubmissionA : TxResubmissionAction +txResubmissionA -[#green,bold]-> finished + +txResubmissionB : TxResubmissionAction +txResubmissionB -[#green,bold]-> updateChainTip download : DownloadAction download -[#green,bold]-> scan @@ -42,7 +48,7 @@ clearAlreadyScannedBlocks : ClearAlreadyScannedBlocksAction clearAlreadyScannedBlocks -[#green,bold]-> enhance enhance : EnhanceAction -enhance -[#green,bold]-> updateChainTip : Range NOT finished +enhance -[#green,bold]-> txResubmissionB : Range NOT finished enhance -[#green,bold]-> clearCache : Range finished, clear cache and check the scan ranges note right of enhance diff --git a/docs/images/cbp_state_machine.png b/docs/images/cbp_state_machine.png index 021c089d..4ec1aac6 100644 Binary files a/docs/images/cbp_state_machine.png and b/docs/images/cbp_state_machine.png differ