aboutsummaryrefslogtreecommitdiffstats
path: root/packages/subproviders/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'packages/subproviders/src/utils')
-rw-r--r--packages/subproviders/src/utils/wallet_utils.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/subproviders/src/utils/wallet_utils.ts b/packages/subproviders/src/utils/wallet_utils.ts
index 097d2b82f..d5ebf5ce6 100644
--- a/packages/subproviders/src/utils/wallet_utils.ts
+++ b/packages/subproviders/src/utils/wallet_utils.ts
@@ -22,19 +22,20 @@ class DerivedHDKeyIterator implements IterableIterator<DerivedHDKey> {
public next(): IteratorResult<DerivedHDKey> {
const derivationBasePath = this._initialDerivedKey.derivationBasePath;
const derivationIndex = this._index;
+ const isChildKey = this._initialDerivedKey.isChildKey;
// If the DerivedHDKey is a child then we walk relative, if not we walk the full derivation path
const fullDerivationPath = `m/${derivationBasePath}/${derivationIndex}`;
const relativeDerivationPath = `m/${derivationIndex}`;
- const path = this._initialDerivedKey.isChildKey ? relativeDerivationPath : fullDerivationPath;
+ const path = isChildKey ? relativeDerivationPath : fullDerivationPath;
const hdKey = this._initialDerivedKey.hdKey.derive(path);
const address = walletUtils.addressOfHDKey(hdKey);
const derivedKey: DerivedHDKey = {
address,
hdKey,
- derivationPath: fullDerivationPath,
- derivationBasePath: this._initialDerivedKey.derivationBasePath,
+ derivationBasePath,
derivationIndex,
- isChildKey: this._initialDerivedKey.isChildKey,
+ derivationPath: fullDerivationPath,
+ isChildKey,
};
const done = this._index === this._searchLimit;
this._index++;