reconfigure rescan logic to raise maxNumberOfIndexesToCheck as needed

so if we have activity beyond index 1000, maxNumberOfIndexesToCheck effectively increases
This commit is contained in:
sneurlax 2023-10-21 16:51:45 -05:00
parent 5720f08aad
commit 93a0f1f6ab

View file

@ -472,8 +472,14 @@ class BitcoinCashWallet extends CoinServiceAPI
int gapCounter = 0;
int highestIndexWithHistory = 0;
// Loop until either the index limit or the highest index with history,
// whichever is greater, plus the gap limit, so that we if there is activity
// above the max index, the limit is raised to that index plus the gap limit.
for (int index = 0;
index < maxNumberOfIndexesToCheck && gapCounter < maxUnusedAddressGap;
index <
max(maxNumberOfIndexesToCheck,
highestIndexWithHistory + maxUnusedAddressGap) &&
gapCounter < maxUnusedAddressGap;
index += txCountBatchSize) {
List<String> iterationsAddressArray = [];
Logging.instance.log(