Skip to content

Commit d76e6ee

Browse files
fix: createNewAccount always non-hardened derivation
1 parent f30bd0e commit d76e6ee

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,7 @@ public class BIP32Keystore: AbstractKeystore {
155155
guard let newAddress = Utilities.publicToAddress(newNode.publicKey) else {
156156
throw AbstractKeystoreError.keyDerivationError
157157
}
158-
let prefixPath = self.rootPrefix
159-
var newPath: String
160-
if newNode.isHardened {
161-
newPath = prefixPath + "/" + String(newNode.index % HDNode.hardenedIndexPrefix) + "'"
162-
} else {
163-
newPath = prefixPath + "/" + String(newNode.index)
164-
}
158+
let newPath = rootPrefix + "/" + String(newNode.index)
165159
addressStorage.add(address: newAddress, for: newPath)
166160
}
167161

0 commit comments

Comments
 (0)