From 9bf8fcefcd7b77b08af3613285a47b161221b80a Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Tue, 2 Jul 2024 09:01:27 +0200 Subject: [PATCH] [#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions (#1454) - addressed comments from the PR, logs enhanced to feature height and demo app logs issues first before any other code is executed [#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions (#1454) - txId log --- .../ZcashLightClientSample/Send/SendViewController.swift | 4 ++-- .../Block/Actions/TxResubmissionAction.swift | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Example/ZcashLightClientSample/ZcashLightClientSample/Send/SendViewController.swift b/Example/ZcashLightClientSample/ZcashLightClientSample/Send/SendViewController.swift index 58e82fd7..822f33f7 100644 --- a/Example/ZcashLightClientSample/ZcashLightClientSample/Send/SendViewController.swift +++ b/Example/ZcashLightClientSample/ZcashLightClientSample/Send/SendViewController.swift @@ -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)") } } } diff --git a/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift b/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift index 424d5fb9..34455dca 100644 --- a/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift +++ b/Sources/ZcashLightClientKit/Block/Actions/TxResubmissionAction.swift @@ -49,17 +49,17 @@ extension TxResubmissionAction: Action { let encodedTransaction = try transaction.encodedTransaction() try await transactionEncoder.submit(transaction: encodedTransaction) - logger.info("TxResubmissionAction trying to resubmit transaction") + logger.info("TxResubmissionAction trying to resubmit transaction at \(latestBlockHeight) height, txId \(transaction.rawID.toHexStringTxId()).") } } catch { - logger.error("TxResubmissionAction failed to resubmit candidates") + logger.error("TxResubmissionAction failed to resubmit candidates at \(latestBlockHeight) height.") } latestResolvedTime = Date().timeIntervalSince1970 } } } catch { - logger.error("TxResubmissionAction failed to find candidates") + logger.error("TxResubmissionAction failed to find candidates at \(latestBlockHeight) height.") } if await context.prevState == .enhance {