From c761b9ae655ca39ec79c5979e4ee779d31f33b4a Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 21 Oct 2023 16:53:45 -0500 Subject: [PATCH] rename variable to be more accurate according to last commit's logic --- .../coins/bitcoincash/bitcoincash_wallet.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 5d3501f82..cb71d4f4e 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -461,7 +461,7 @@ class BitcoinCashWallet extends CoinServiceAPI } Future, DerivePathType, int>> _checkGaps( - int maxNumberOfIndexesToCheck, + int minNumberOfIndexesToCheck, int maxUnusedAddressGap, int txCountBatchSize, bip32.BIP32 root, @@ -472,12 +472,13 @@ 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. + // Scan addresses until the minimum required addresses have been scanned or + // until the highest index with activity, plus the gap limit, whichever is + // higher, so that we if there is activity above the minimum index, we don't + // miss it. for (int index = 0; index < - max(maxNumberOfIndexesToCheck, + max(minNumberOfIndexesToCheck, highestIndexWithHistory + maxUnusedAddressGap) && gapCounter < maxUnusedAddressGap; index += txCountBatchSize) {