Skip to content

Commit

Permalink
Include also the last index in isOwnAddress (#208)
Browse files Browse the repository at this point in the history
* Include also the last index in isOwnAddress

* sum MAX_ACCOUNT_GAP
  • Loading branch information
panleone authored Sep 26, 2023
1 parent 8fcdd79 commit 5b97200
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b97200

Please sign in to comment.