Skip to content

Commit

Permalink
Fix isOwnAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Oct 3, 2023
1 parent 5fed233 commit cdbe2d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,11 @@ export class Wallet {
getNetwork().getLastWallet(nReceiving),
this.#addressIndeces.get(nReceiving) ?? 0
);

if (this.isHD()) {
for (let i = 0; i <= maxIndex + MAX_ACCOUNT_GAP; i++) {
const path = this.getDerivationPath(nReceiving, i);
console.log(nReceiving, path);
const testAddress = await this.#masterKey.getAddress(path);
if (address === testAddress) {
this.#ownAddresses.set(address, path);
Expand All @@ -244,10 +246,9 @@ export class Wallet {
this.#ownAddresses.set(address, value);
return value;
}

this.#ownAddresses.set(address, null);
return null;
}
this.#ownAddresses.set(address, null);
return null;
}

/**
Expand Down

0 comments on commit cdbe2d1

Please sign in to comment.