Closed molxyz closed 2 years ago
You can only run changepassword
with the wallet unlocker active. The command tries, but doesn't actually succeed. We should update the error message there to make this more explicit.
If I'm reading this correctly, the wallet unlocker service is deactivated after the wallet is unlocked. Is there any way to activate the service on the fly? Right now, I have to restart lnd and then change the password.
Is there any way to activate the service on the fly?
Not at the moment.
may be can help https://github.com/lightningnetwork/lnd/blob/master/docs/wallet.md
$ lncli changepassword
# or
$lncli --network=testnet changepassword
# or
$tlncli changepassword
here: https://api.lightning.community/?shell#v1-changepassword
$ MACAROON_HEADER="Grpc-Metadata-macaroon: $(xxd -ps -u -c 1000 $LND_DIR/data/chain/bitcoin/simnet/admin.macaroon)"
$ curl -X POST --cacert $LND_DIR/tls.cert --header "$MACAROON_HEADER" https://localhost:8080/v1/changepassword \
-d '{ "current_password":<byte>,"new_password":<byte>,"stateless_init":<boolean>,"new_macaroon_root_key":<boolean>, }'
{
"admin_macaroon": <byte>,
}
This issue is only about the error message, really.
Currently if you try to change the password after the wallet is already unlocked, lncli
will return:
[lncli] Wallet is encrypted. Please unlock using 'lncli unlock', or set password using 'lncli create' if this is the first time starting lnd.
While it should probably say something more specific or more informative.
Fixed by #6349.
Background
When LND node is unlocked and running, try to change password by entering on a different terminal screen. LND seems to allow the password to be changed but actually it is not changed.
Your environment
lnd
"version": "0.5.1-beta commit=v0.5.1-beta-461-g375be936ce3df375e6c2686b190563d7076ecf40",uname -a
on *Nix) Ubuntu 16.04 Bitcoind v0.17.99Steps to reproduce
While lnd is already unlocked and running, on another terminal screen try to change your password.
Now try to unlock the wallet when it's already unlocked... lol
Then stop LND from running. Now try to restart LND with the new password.
Expected behaviour
If trying to change password when the node is already unlocked and running, LND should not allow the steps to happen and should issue an error message such as