nano-node icon indicating copy to clipboard operation
nano-node copied to clipboard

Tidy up of wallet locking and password RPC commands

Open dsiganos opened this issue 2 years ago • 2 comments

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

dsiganos avatar Mar 21 '22 17:03 dsiganos

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 avatar Mar 22 '22 00:03 dsiganos

@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?

zhyatt avatar Mar 22 '22 20:03 zhyatt