You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2019. It is now read-only.
In KeyStore.swift:
''public func update(wallet: Wallet, password: String, newPassword: String)''
I does not see rewritting KeystoreKey to local file, so I add this code to the method
public func update(wallet: Wallet, password: String, newPassword: String) throws {
guard let index = wallets.index(of: wallet) else {
fatalError("Missing wallet")
}
var privateKeyData = try wallet.key.decrypt(password: password)
defer {
privateKeyData.resetBytes(in: 0 ..< privateKeyData.count)
}
switch wallet.key.type {
case .encryptedKey:
guard let privateKey = PrivateKey(data: privateKeyData) else {
throw Error.invalidKey
}
wallets[index].key = try KeystoreKey(password: newPassword, key: privateKey, coin: wallet.key.coin)
case .hierarchicalDeterministicWallet:
guard let string = String(data: privateKeyData, encoding: .ascii) else {
throw EncryptError.invalidMnemonic
}
wallets[index].key = try KeystoreKey(password: newPassword, mnemonic: string, passphrase: wallet.key.passphrase)
}
// fix bugs: write to local key file
// @author xuhaiqing
try save(key: wallets[index].key, to: keyDirectory)
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In KeyStore.swift:
''public func update(wallet: Wallet, password: String, newPassword: String)''
I does not see rewritting KeystoreKey to local file, so I add this code to the method
public func update(wallet: Wallet, password: String, newPassword: String) throws {
guard let index = wallets.index(of: wallet) else {
fatalError("Missing wallet")
}
The text was updated successfully, but these errors were encountered: