From 5b97200fec78737df7fcfb7c1a86e219c9e7c5df Mon Sep 17 00:00:00 2001 From: Alessandro Rezzi Date: Tue, 26 Sep 2023 20:51:00 +0200 Subject: [PATCH] Include also the last index in isOwnAddress (#208) * Include also the last index in isOwnAddress * sum MAX_ACCOUNT_GAP --- scripts/wallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wallet.js b/scripts/wallet.js index c13ac4a9c..6e79d3da6 100644 --- a/scripts/wallet.js +++ b/scripts/wallet.js @@ -219,7 +219,7 @@ export class Wallet { this.#addressIndex = this.#addressIndex > last ? this.#addressIndex : last; if (this.isHD()) { - for (let i = 0; i < this.#addressIndex; i++) { + for (let i = 0; i <= this.#addressIndex + MAX_ACCOUNT_GAP; i++) { const path = this.getDerivationPath(0, i); const testAddress = await this.#masterKey.getAddress(path); if (address === testAddress) {