diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index 4fd165f8..471eb066 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -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_); };