nano-node
nano-node copied to clipboard
Tidy up of wallet locking and password RPC commands
Tidy up of wallet locking and password RPC commands. The following should be done:
- password_valid: deprecated in favor of existing wallet_locked (which implies there is a valid password existing already)
- wallet_key_valid: deprecated in favor of existing wallet_locked (which implies there is a valid password existing already)
- password_change: deprecated in favor of new alias wallet_password_set
- password_enter: deprecated in favor of new alias wallet_unlock
Example use case:
Set a password for a wallet with wallet_password_set
Lock a wallet (using the password set above) with wallet_lock
Unlock a wallet with wallet_unlock
Check if a wallet is locked with wallet_locked
@dsiganos After further review, the password_valid
/wallet_key_valid
calls will return "valid":"0"
if there is no password set on the wallet. That information is not otherwise available so we need to consider whether it should be kept in some form, as wallet_lock
currently returns "locked":"1"
even when no password is not set (and the wallet thus cannot be locked). So I guess two things:
- Fix
wallet_lock
to return something other than"locked":"1"
when there is no password - Perhaps keep one of the valid calls and rename it to
wallet_password_exists
to be more explicit about its use
Thoughts?