mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
Fix error reporting in transaction creation (#1821)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user