From cdbe2d1e7c41d7fc638bb09a5aba9220c0fc0c26 Mon Sep 17 00:00:00 2001 From: Duddino Date: Tue, 3 Oct 2023 11:55:06 +0200 Subject: [PATCH] Fix isOwnAddress --- scripts/wallet.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/wallet.js b/scripts/wallet.js index 2b7ee2f2d..fadc66df9 100644 --- a/scripts/wallet.js +++ b/scripts/wallet.js @@ -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); @@ -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; } /**