Skip to content

Commit cd99e5b

Browse files
committed
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 1e79c05. Tree-SHA512: c775cc9181e4034f26c5b219974e06886435275933249b169d2bc8bc98f639c4027e1e7d991f43bded62146a141acee6d3be1f2b313042d9bbc0a5d2e71d6c7c
2 parents 047865e + 61f8298 commit cd99e5b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,18 +1023,18 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
10231023
new_request.params.push_back(request.params[1]);
10241024
new_request.params.push_back(request.params[3]);
10251025
return signrawtransactionwithkey(new_request);
1026-
}
1027-
// Otherwise sign with the wallet which does not take a privkeys parameter
1026+
} else {
10281027
#ifdef ENABLE_WALLET
1029-
else {
1028+
// Otherwise sign with the wallet which does not take a privkeys parameter
10301029
new_request.params.push_back(request.params[0]);
10311030
new_request.params.push_back(request.params[1]);
10321031
new_request.params.push_back(request.params[3]);
10331032
return signrawtransactionwithwallet(new_request);
1034-
}
1033+
#else
1034+
// If we have made it this far, then wallet is disabled and no private keys were given, so fail here.
1035+
throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available.");
10351036
#endif
1036-
// If we have made it this far, then wallet is disabled and no private keys were given, so fail here.
1037-
throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available.");
1037+
}
10381038
}
10391039

10401040
UniValue sendrawtransaction(const JSONRPCRequest& request)

0 commit comments

Comments
 (0)