From cfe78d4e5f9f838ae1be6a7d2d3397dc2771bd4a Mon Sep 17 00:00:00 2001 From: cyan Date: Sun, 24 Nov 2024 09:49:42 +0100 Subject: [PATCH] Fix error reporting in transaction creation (#1821) --- cw_monero/lib/api/transaction_history.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cw_monero/lib/api/transaction_history.dart b/cw_monero/lib/api/transaction_history.dart index 7748a16af..f55545801 100644 --- a/cw_monero/lib/api/transaction_history.dart +++ b/cw_monero/lib/api/transaction_history.dart @@ -192,14 +192,23 @@ String? commitTransaction({required monero.PendingTransaction transactionPointer ? monero.PendingTransaction_commitUR(transactionPointer, 120) : monero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false); - final String? error = (() { + String? error = (() { final status = monero.PendingTransaction_status(transactionPointer.cast()); if (status == 0) { return null; } - return monero.Wallet_errorString(wptr!); + return monero.PendingTransaction_errorString(transactionPointer.cast()); })(); + if (error == null) { + error = (() { + final status = monero.Wallet_status(wptr!); + if (status == 0) { + return null; + } + return monero.Wallet_errorString(wptr!); + })(); + } if (error != null) { throw CreationTransactionException(message: error); }