restore all paynym history function

This commit is contained in:
julian 2023-01-27 14:43:38 -06:00
parent c7446f1946
commit b09b3d0e1f
2 changed files with 20 additions and 0 deletions

View file

@ -545,6 +545,12 @@ class DogecoinWallet extends CoinServiceAPI
// refresh transactions to pick up any received notification transactions // refresh transactions to pick up any received notification transactions
await _refreshTransactions(); await _refreshTransactions();
// restore paynym transactions
await restoreAllHistory(
maxUnusedAddressGap: maxUnusedAddressGap,
maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
);
await _updateUTXOs(); await _updateUTXOs();
await Future.wait([ await Future.wait([

View file

@ -724,6 +724,20 @@ mixin PaynymWalletInterface {
return unBlindedList; 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( Future<void> restoreHistoryWith(
PaymentCode other, PaymentCode other,
int maxUnusedAddressGap, int maxUnusedAddressGap,