From fd6801cafb6d3c61b4738e06ca7985a64d48ab35 Mon Sep 17 00:00:00 2001 From: cyan Date: Wed, 11 Dec 2024 16:03:34 -0500 Subject: [PATCH] CW-834 Empty error when spending in wownero (#1870) * CW-834 Empty error when spending in wownero * monero -> wownero --- cw_wownero/lib/api/transaction_history.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cw_wownero/lib/api/transaction_history.dart b/cw_wownero/lib/api/transaction_history.dart index ce93df7d1..3cebdd811 100644 --- a/cw_wownero/lib/api/transaction_history.dart +++ b/cw_wownero/lib/api/transaction_history.dart @@ -181,13 +181,23 @@ void commitTransaction({required wownero.PendingTransaction transactionPointer}) final txCommit = wownero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false); - final String? error = (() { + String? error = (() { final status = wownero.PendingTransaction_status(transactionPointer.cast()); if (status == 0) { return null; } - return wownero.Wallet_errorString(wptr!); + return wownero.PendingTransaction_errorString(transactionPointer.cast()); })(); + if (error == null) { + error = (() { + final status = wownero.Wallet_status(wptr!); + if (status == 0) { + return null; + } + return wownero.Wallet_errorString(wptr!); + })(); + + } if (error != null) { throw CreationTransactionException(message: error);