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 1e79c055cd.

Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
This commit is contained in:
Wladimir J. van der Laan 2018-03-29 15:04:57 +02:00 committed by pasta
parent 2aee09c5ab
commit 97260e84b0
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -1047,18 +1047,18 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
new_request.params.push_back(request.params[1]); new_request.params.push_back(request.params[1]);
new_request.params.push_back(request.params[3]); new_request.params.push_back(request.params[3]);
return signrawtransactionwithkey(new_request); return signrawtransactionwithkey(new_request);
} } else {
// Otherwise sign with the wallet which does not take a privkeys parameter
#ifdef ENABLE_WALLET #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[0]);
new_request.params.push_back(request.params[1]); new_request.params.push_back(request.params[1]);
new_request.params.push_back(request.params[3]); new_request.params.push_back(request.params[3]);
return signrawtransactionwithwallet(new_request); 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 #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) UniValue sendrawtransaction(const JSONRPCRequest& request)