Skip to content

Commit

Permalink
Merge pull request bcoin-org#307 from Bucko13/setpassphrase-fix
Browse files Browse the repository at this point in the history
More consistent behavior around setting passphrase on unencrypted wallet
  • Loading branch information
chjj authored Oct 19, 2017
2 parents 5ba79e4 + 778e118 commit a1ec1c2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/wallet/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
};

Expand Down

0 comments on commit a1ec1c2

Please sign in to comment.