implement tux's fix for changing property name and more consistent behavior around setting passphrase on unencrypted wallet
This commit is contained in:
parent
7145d21c9c
commit
778e118378
@ -673,7 +673,7 @@ HTTPClient.prototype.retoken = async function retoken(id, passphrase) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
HTTPClient.prototype.setPassphrase = function setPassphrase(id, old, new_) {
|
HTTPClient.prototype.setPassphrase = function setPassphrase(id, old, new_) {
|
||||||
const body = { old: old, passphrase: new_ };
|
const body = { old: old, new: new_ };
|
||||||
return this._post(`/wallet/${id}/passphrase`, body);
|
return this._post(`/wallet/${id}/passphrase`, body);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user