mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
CW-214-Monero-wallet-rescan-bug (#945)
* clear transactionHistory before rescan * move the clear method to the abstract class
This commit is contained in:
parent
181fd21636
commit
02fd12f5f8
4 changed files with 5 additions and 0 deletions
|
@ -86,4 +86,5 @@ abstract class ElectrumTransactionHistoryBase
|
|||
|
||||
void _update(ElectrumTransactionInfo transaction) =>
|
||||
transactions[transaction.id] = transaction;
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ abstract class TransactionHistoryBase<TransactionType extends TransactionInfo> {
|
|||
|
||||
void addMany(Map<String, TransactionType> transactions);
|
||||
|
||||
void clear() => transactions.clear();
|
||||
|
||||
// bool _isUpdating;
|
||||
|
||||
// @action
|
||||
|
|
|
@ -24,4 +24,5 @@ abstract class MoneroTransactionHistoryBase
|
|||
@override
|
||||
void addMany(Map<String, MoneroTransactionInfo> transactions) =>
|
||||
this.transactions.addAll(transactions);
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ abstract class RescanViewModelBase with Store {
|
|||
Future<void> rescanCurrentWallet({required int restoreHeight}) async {
|
||||
state = RescanWalletState.rescaning;
|
||||
await _wallet.rescan(height: restoreHeight);
|
||||
_wallet.transactionHistory.clear();
|
||||
state = RescanWalletState.none;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue