From 3ad693d33409dfd9d61beff3f43c4abaa369c6b1 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Wed, 11 Apr 2018 14:22:02 +1000 Subject: Test valid address format but not found --- packages/subproviders/src/utils/wallet_utils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'packages/subproviders/src/utils') 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 { public next(): IteratorResult { 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++; -- cgit