Merge pull request #307 from Bucko13/setpassphrase-fix

More consistent behavior around setting passphrase on unencrypted wallet
This commit is contained in:
Christopher Jeffrey (JJ) 2017-10-18 22:44:02 -07:00 committed by GitHub
commit a1ec1c255e

View File

@ -366,15 +366,10 @@ Wallet.prototype._removeSharedKey = async function _removeSharedKey(acct, key) {
*/ */
Wallet.prototype.setPassphrase = async function setPassphrase(old, new_) { Wallet.prototype.setPassphrase = async function setPassphrase(old, new_) {
if (new_ == null) { if (old)
new_ = old;
old = null;
}
if (old != null)
await this.decrypt(old); await this.decrypt(old);
if (new_ != null) if (new_)
await this.encrypt(new_); await this.encrypt(new_);
}; };