mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
Fix error reporting in transaction creation (#1821)
Some checks failed
Cache Dependencies / test (push) Has been cancelled
Some checks failed
Cache Dependencies / test (push) Has been cancelled
This commit is contained in:
parent
29b659e748
commit
cfe78d4e5f
1 changed files with 11 additions and 2 deletions
|
@ -192,14 +192,23 @@ String? commitTransaction({required monero.PendingTransaction transactionPointer
|
||||||
? monero.PendingTransaction_commitUR(transactionPointer, 120)
|
? monero.PendingTransaction_commitUR(transactionPointer, 120)
|
||||||
: monero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false);
|
: monero.PendingTransaction_commit(transactionPointer, filename: '', overwrite: false);
|
||||||
|
|
||||||
final String? error = (() {
|
String? error = (() {
|
||||||
final status = monero.PendingTransaction_status(transactionPointer.cast());
|
final status = monero.PendingTransaction_status(transactionPointer.cast());
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
return null;
|
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) {
|
if (error != null) {
|
||||||
throw CreationTransactionException(message: error);
|
throw CreationTransactionException(message: error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue