mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #12727: [RPC] Remove unreachable help conditions in rpcwallet.cpp
e5468a19d1
Remove unreachable help conditions (lutangar)
Pull request description:
These conditions on `request.fHelp`, which appears in the body of the following functions are never reached:
* `walletpassphrase`
* `walletpassphrasechange`
* `encryptwallet`
```
...
if (request.fHelp || request.params.size() != 0) {
throw std::runtime_error("");
}
...
if (request.fHelp)
return true;
...
```
The first condition would throw if `request.fHelp` evaluates to `true`.
Tree-SHA512: 1aa41ed233c6bebae27151ab5cc67144d2a408335a3acef3c103e144d6343685f360b1146e14bc8dc1d53d00fcfc6ff1ab6a0eeb0805191172a23b306ab50b79
This commit is contained in:
parent
1634d58421
commit
1d911cbe6a
@ -2261,8 +2261,6 @@ UniValue walletpassphrase(const JSONRPCRequest& request)
|
||||
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
|
||||
if (request.fHelp)
|
||||
return true;
|
||||
if (!pwallet->IsCrypted()) {
|
||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
|
||||
}
|
||||
@ -2331,8 +2329,6 @@ UniValue walletpassphrasechange(const JSONRPCRequest& request)
|
||||
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
|
||||
if (request.fHelp)
|
||||
return true;
|
||||
if (!pwallet->IsCrypted()) {
|
||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
|
||||
}
|
||||
@ -2387,8 +2383,6 @@ UniValue walletlock(const JSONRPCRequest& request)
|
||||
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
|
||||
if (request.fHelp)
|
||||
return true;
|
||||
if (!pwallet->IsCrypted()) {
|
||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called.");
|
||||
}
|
||||
@ -2434,8 +2428,6 @@ UniValue encryptwallet(const JSONRPCRequest& request)
|
||||
|
||||
LOCK2(cs_main, pwallet->cs_wallet);
|
||||
|
||||
if (request.fHelp)
|
||||
return true;
|
||||
if (pwallet->IsCrypted()) {
|
||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user