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)

- addressed comments from the PR, logs enhanced to feature height and demo app logs issues first before any other code is executed

[Electric-Coin-Company#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions (Electric-Coin-Company#1454)

- txId log

[Electric-Coin-Company#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions (Electric-Coin-Company#1454)

- logs tweaked
  • Loading branch information
LukasKorba committed Jul 3, 2024
1 parent 528f380 commit 09028c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ class SendViewController: UIViewController {
// swiftlint:disable:next force_try
memo: try! self.memoField.text.asMemo()
)
KRProgressHUD.dismiss()
loggerProxy.info("transaction created: \(pendingTransaction)")
KRProgressHUD.dismiss()
} catch {
loggerProxy.error("SEND FAILED: \(error)")
KRProgressHUD.dismiss()
fail(error)
loggerProxy.error("SEND FAILED: \(error)")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ extension TxResubmissionAction: Action {

// find all candidates for the resubmission
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 All @@ -46,20 +47,20 @@ extension TxResubmissionAction: Action {
// resubmission
do {
for transaction in transactions {
logger.info("TxResubmissionAction trying to resubmit transaction \(transaction.rawID.toHexStringTxId()).")
let encodedTransaction = try transaction.encodedTransaction()

try await transactionEncoder.submit(transaction: encodedTransaction)
logger.info("TxResubmissionAction trying to resubmit transaction")
}
} catch {
logger.error("TxResubmissionAction failed to resubmit candidates")
logger.error("TxResubmissionAction failed to resubmit candidates.")
}

latestResolvedTime = Date().timeIntervalSince1970
}
}
} catch {
logger.error("TxResubmissionAction failed to find candidates")
logger.error("TxResubmissionAction failed to find candidates.")
}

if await context.prevState == .enhance {
Expand Down

0 comments on commit 09028c3

Please sign in to comment.