Skip to content

Commit 720d9e8

Browse files
committed
[Wallet] always show help-line of wallet encryption calls
1 parent 8335cb4 commit 720d9e8

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
@@ -2179,7 +2179,7 @@ UniValue walletpassphrase(const JSONRPCRequest& request)
21792179
return NullUniValue;
21802180
}
21812181

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

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

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

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

0 commit comments

Comments
 (0)