Merge pull request #307 from Bucko13/setpassphrase-fix
More consistent behavior around setting passphrase on unencrypted wallet
This commit is contained in:
commit
a1ec1c255e
@ -366,15 +366,10 @@ Wallet.prototype._removeSharedKey = async function _removeSharedKey(acct, key) {
|
||||
*/
|
||||
|
||||
Wallet.prototype.setPassphrase = async function setPassphrase(old, new_) {
|
||||
if (new_ == null) {
|
||||
new_ = old;
|
||||
old = null;
|
||||
}
|
||||
|
||||
if (old != null)
|
||||
if (old)
|
||||
await this.decrypt(old);
|
||||
|
||||
if (new_ != null)
|
||||
if (new_)
|
||||
await this.encrypt(new_);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user