Skip to content

Commit bfb270a

Browse files
author
MarcoFalke
committed
Merge #11590: [Wallet] always show help-line of wallet encryption calls
720d9e8 [Wallet] always show help-line of wallet encryption calls (Jonas Schnelli) Pull request description: We do currently show/hide the wallet encryption RPC calls from the help if the current wallet. In case of an encrypted wallet, `encryptwallet` is hidden and `walletpassphrasechange`, `walletpassphrasechange` and `walletlock` do appear in the help. This is no longer ideal in case of multiwallet due to the fact that one may want help infos in order to target a specific wallet. IMO its preferable to have a static help screen (show everything always). The currently show/hidden calls do handle the possible invalid encryption-state fine. Fixes #11588 Tree-SHA512: 513fecd15248a31361f5143685e8cdeb63dfd3fa7120828917e1db54d936dc3db60d48ce46efa5c3a563a48157fe962689879856eeeed53f904686b12aec204e
2 parents 1b8c884 + 720d9e8 commit bfb270a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ UniValue walletpassphrase(const JSONRPCRequest& request)
21802180
return NullUniValue;
21812181
}
21822182

2183-
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) {
2183+
if (request.fHelp || request.params.size() != 2) {
21842184
throw std::runtime_error(
21852185
"walletpassphrase \"passphrase\" timeout\n"
21862186
"\nStores the wallet decryption key in memory for 'timeout' seconds.\n"
@@ -2244,7 +2244,7 @@ UniValue walletpassphrasechange(const JSONRPCRequest& request)
22442244
return NullUniValue;
22452245
}
22462246

2247-
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) {
2247+
if (request.fHelp || request.params.size() != 2) {
22482248
throw std::runtime_error(
22492249
"walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n"
22502250
"\nChanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.\n"
@@ -2295,7 +2295,7 @@ UniValue walletlock(const JSONRPCRequest& request)
22952295
return NullUniValue;
22962296
}
22972297

2298-
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 0)) {
2298+
if (request.fHelp || request.params.size() != 0) {
22992299
throw std::runtime_error(
23002300
"walletlock\n"
23012301
"\nRemoves the wallet encryption key from memory, locking the wallet.\n"
@@ -2335,7 +2335,7 @@ UniValue encryptwallet(const JSONRPCRequest& request)
23352335
return NullUniValue;
23362336
}
23372337

2338-
if (!pwallet->IsCrypted() && (request.fHelp || request.params.size() != 1)) {
2338+
if (request.fHelp || request.params.size() != 1) {
23392339
throw std::runtime_error(
23402340
"encryptwallet \"passphrase\"\n"
23412341
"\nEncrypts the wallet with 'passphrase'. This is for first time encryption.\n"

0 commit comments

Comments
 (0)