aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-03-29 15:04:57 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-29 15:05:49 +0200
commitcd99e5bdc8fc72948dc6133a024b8b98481242fc (patch)
tree0e7ad9fca40312fc87904eabd64dfae0fa56e0cf /src
parent047865e8d188e17eb098e5b7f37ca74b213ae720 (diff)
parent61f82981b2e12866520a5eceada4bf759754f827 (diff)
Merge #12787: rpc: Adjust ifdef to avoid unreachable code
61f8298 rpc: Adjust ifdef to avoid unreachable code (practicalswift) Pull request description: Adjust `ifdef` to avoid unreachable code. Introduced in 1e79c055cd30d21ba5f8c7f81ef911d5d4e295a8. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
Diffstat (limited to 'src')
-rw-r--r--src/rpc/rawtransaction.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 20bfd3f355..77040f75fd 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -1023,18 +1023,18 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
new_request.params.push_back(request.params[1]);
new_request.params.push_back(request.params[3]);
return signrawtransactionwithkey(new_request);
- }
- // Otherwise sign with the wallet which does not take a privkeys parameter
+ } else {
#ifdef ENABLE_WALLET
- else {
+ // Otherwise sign with the wallet which does not take a privkeys parameter
new_request.params.push_back(request.params[0]);
new_request.params.push_back(request.params[1]);
new_request.params.push_back(request.params[3]);
return signrawtransactionwithwallet(new_request);
- }
+#else
+ // If we have made it this far, then wallet is disabled and no private keys were given, so fail here.
+ throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available.");
#endif
- // If we have made it this far, then wallet is disabled and no private keys were given, so fail here.
- throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available.");
+ }
}
UniValue sendrawtransaction(const JSONRPCRequest& request)