aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-12-06 10:52:29 -0500
committerMarcoFalke <falke.marco@gmail.com>2017-12-06 11:00:08 -0500
commitfa4c16d2e72a8ec1032da49a68c9913c2595dbfe (patch)
treedde5119baf020bffdd4699d4b841032a43f035fc /src/rpc
parent497d0e014cc79d46531d570e74e4aeae72db602d (diff)
downloadbitcoin-fa4c16d2e72a8ec1032da49a68c9913c2595dbfe.tar.xz
qa: Add getrawtransaction in_active_chain=False test
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index b26f10e476..018c255325 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -155,14 +155,12 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
if (!request.params[2].isNull()) {
uint256 blockhash = ParseHashV(request.params[2], "parameter 3");
- if (!blockhash.IsNull()) {
- BlockMap::iterator it = mapBlockIndex.find(blockhash);
- if (it == mapBlockIndex.end()) {
- throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block hash not found");
- }
- blockindex = it->second;
- in_active_chain = chainActive.Contains(blockindex);
+ BlockMap::iterator it = mapBlockIndex.find(blockhash);
+ if (it == mapBlockIndex.end()) {
+ throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block hash not found");
}
+ blockindex = it->second;
+ in_active_chain = chainActive.Contains(blockindex);
}
CTransactionRef tx;