Skip to content

Commit

Permalink
[Electric-Coin-Company#1452] TX Resubmission-the wallet has to period…
Browse files Browse the repository at this point in the history
…ically resubmit unmined transactions (Electric-Coin-Company#1454)

- State machine puml and png files updated
- Order of transaction removed because it has no effect
  • Loading branch information
LukasKorba committed Jul 3, 2024
1 parent de9b8b5 commit 85c7834
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion Sources/ZcashLightClientKit/DAO/TransactionDao.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions docs/cbp_state_machine.puml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Binary file modified docs/images/cbp_state_machine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 85c7834

Please sign in to comment.