mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
restore all paynym history function
This commit is contained in:
parent
c7446f1946
commit
b09b3d0e1f
2 changed files with 20 additions and 0 deletions
|
@ -545,6 +545,12 @@ class DogecoinWallet extends CoinServiceAPI
|
|||
// refresh transactions to pick up any received notification transactions
|
||||
await _refreshTransactions();
|
||||
|
||||
// restore paynym transactions
|
||||
await restoreAllHistory(
|
||||
maxUnusedAddressGap: maxUnusedAddressGap,
|
||||
maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
|
||||
);
|
||||
|
||||
await _updateUTXOs();
|
||||
|
||||
await Future.wait([
|
||||
|
|
|
@ -724,6 +724,20 @@ mixin PaynymWalletInterface {
|
|||
return unBlindedList;
|
||||
}
|
||||
|
||||
Future<void> restoreAllHistory({
|
||||
required int maxUnusedAddressGap,
|
||||
required int maxNumberOfIndexesToCheck,
|
||||
}) async {
|
||||
final codes = await getAllPaymentCodesFromNotificationTransactions();
|
||||
final List<Future<void>> futures = [];
|
||||
for (final code in codes) {
|
||||
futures.add(restoreHistoryWith(
|
||||
code, maxUnusedAddressGap, maxNumberOfIndexesToCheck));
|
||||
}
|
||||
|
||||
await Future.wait(futures);
|
||||
}
|
||||
|
||||
Future<void> restoreHistoryWith(
|
||||
PaymentCode other,
|
||||
int maxUnusedAddressGap,
|
||||
|
|
Loading…
Reference in a new issue