mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix(cw_monero): transaction not appearing after send (#2268)
* fix: catch error in newly added fetchTransactions call fix: null handling in cw_monero * fix(cw_monero): transaction not appearing after send
This commit is contained in:
parent
557e1c9839
commit
bc52cf485e
3 changed files with 7 additions and 9 deletions
|
@ -446,7 +446,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
|||
|
||||
// final status = monero.PendingTransaction_status(pendingTransactionDescription);
|
||||
|
||||
return PendingMoneroTransaction(pendingTransactionDescription);
|
||||
return PendingMoneroTransaction(pendingTransactionDescription, this);
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:cw_core/amount_converter.dart';
|
|||
|
||||
import 'package:cw_core/pending_transaction.dart';
|
||||
import 'package:cw_monero/api/wallet.dart';
|
||||
import 'package:cw_monero/monero_wallet.dart';
|
||||
|
||||
class DoubleSpendException implements Exception {
|
||||
DoubleSpendException();
|
||||
|
@ -17,9 +18,10 @@ class DoubleSpendException implements Exception {
|
|||
}
|
||||
|
||||
class PendingMoneroTransaction with PendingTransaction {
|
||||
PendingMoneroTransaction(this.pendingTransactionDescription);
|
||||
PendingMoneroTransaction(this.pendingTransactionDescription, this.wallet);
|
||||
|
||||
final PendingTransactionDescription pendingTransactionDescription;
|
||||
final MoneroWalletBase wallet;
|
||||
|
||||
@override
|
||||
String get id => pendingTransactionDescription.hash;
|
||||
|
@ -54,6 +56,7 @@ class PendingMoneroTransaction with PendingTransaction {
|
|||
|
||||
rethrow;
|
||||
}
|
||||
await wallet.fetchTransactions();
|
||||
storeSync(force: true);
|
||||
}
|
||||
|
||||
|
@ -63,6 +66,8 @@ class PendingMoneroTransaction with PendingTransaction {
|
|||
final ret = monero_transaction_history.commitTransactionFromPointerAddress(
|
||||
address: pendingTransactionDescription.pointerAddress,
|
||||
useUR: true);
|
||||
await wallet.fetchTransactions();
|
||||
storeSync(force: true);
|
||||
return ret;
|
||||
} catch (e) {
|
||||
final message = e.toString();
|
||||
|
|
|
@ -593,13 +593,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
}
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
await sharedPreferences.setString(PreferencesKey.backgroundSyncLastTrigger(wallet.name), DateTime.now().add(Duration(minutes: 1)).toIso8601String());
|
||||
unawaited(() {
|
||||
try {
|
||||
wallet.fetchTransactions();
|
||||
} catch (e) {
|
||||
printV(e);
|
||||
}
|
||||
}());
|
||||
state = TransactionCommitted();
|
||||
} catch (e) {
|
||||
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue