Title: bitcoin-cli help encryptwallet Post by: windpath on July 28, 2015, 01:28:18 PM Running "bitcoin-cli help encryptwallet" returns the help page as expected if the wallet is not encrypted, however if the wallet has been encrypted "help encryptwallet" returns "unknown command".
It does not feel like this should be expected behavior, but maybe it is intentional? Command: Code: bitcoin-cli help encryptwallet Result if wallet is encrypted: Code: help: unknown command: encryptwallet Result if wallet has not been encrypted: Code: encryptwallet "passphrase" Edit: Satoshi Client 0.11.0 Title: Re: bitcoin-cli help encryptwallet Post by: Newar on July 28, 2015, 06:16:16 PM My guess would be that somebody who has their wallet encrypted knows how they did it and what it is for. Doesn't make that much sense, but... *shrug* If you feel this could be improved upon, github is the place to go for opening issues. Title: Re: bitcoin-cli help encryptwallet Post by: themerkle on July 28, 2015, 09:11:04 PM I found this: http://bitcoin.stackexchange.com/questions/3587/can-i-remove-the-passphrase-from-my-bitcoin-wallet
The Bitcoin.org client does not yet have the feature to remove encryption from a wallet. You can use a single space as the encryption key but there no way to get it to no longer use encryption. That is expected to be implemented in a future release. In the meantime, those that want this will create a new wallet and leave it unencrypted, and send their coins from the encrypted wallet to it. So I am assuming the encryptwallet function no longer works once you encrypt your wallet. You can still change the passphrase but since there is no way to unencrypt it the function is not even in the scope. Title: Re: bitcoin-cli help encryptwallet Post by: windpath on July 29, 2015, 12:15:00 AM I found this: http://bitcoin.stackexchange.com/questions/3587/can-i-remove-the-passphrase-from-my-bitcoin-wallet The Bitcoin.org client does not yet have the feature to remove encryption from a wallet. You can use a single space as the encryption key but there no way to get it to no longer use encryption. That is expected to be implemented in a future release. In the meantime, those that want this will create a new wallet and leave it unencrypted, and send their coins from the encrypted wallet to it. So I am assuming the encryptwallet function no longer works once you encrypt your wallet. You can still change the passphrase but since there is no way to unencrypt it the function is not even in the scope. I'm aware, however it does not explain this behavior... I'm talking about the HELP command, which when your wallet is encrypted returns "help: unknown command: encryptwallet". While there is no "remove wallet encryption" command, I don't see why you would hide the explanation for that once the wallet is encrypted. Whether your wallet is encrypted or not, the help for the command does not change... Title: Re: bitcoin-cli help encryptwallet Post by: achow101 on July 29, 2015, 01:00:37 AM The root of the problem is in the method for that command here: https://github.com/bitcoin/bitcoin/blob/ca37e0f33980a1fe96ac4ed08fd7d692a7a592a5/src/wallet/rpcwallet.cpp#L1968
The statement determining whether to show the message or not is this Code: if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1)) Help is set to true in this file: https://github.com/bitcoin/bitcoin/blob/240b30eaf0b94a0094b8943dd9c01448bc29c3ba/src/rpcserver.cpp by using the help command. The key part is at line 226 - 227 which are as follows Code: if (strRet == "") This is clearly intentional. Why would they have a specific check for whether the wallet was encrypted or not for the help message. As to why that was done, I don't know. Title: Re: bitcoin-cli help encryptwallet Post by: windpath on July 29, 2015, 01:46:47 AM This is clearly intentional. Why would they have a specific check for whether the wallet was encrypted or not for the help message. As to why that was done, I don't know. I believe there is a good chance it may have been, would like to know why... Edit: Thanks for taking the time to look up the code references! |