diff options
author | MarcoFalke <falke.marco@gmail.com> | 2017-12-06 10:52:29 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2017-12-06 11:00:08 -0500 |
commit | fa4c16d2e72a8ec1032da49a68c9913c2595dbfe (patch) | |
tree | dde5119baf020bffdd4699d4b841032a43f035fc /src/rpc/rawtransaction.cpp | |
parent | 497d0e014cc79d46531d570e74e4aeae72db602d (diff) |
qa: Add getrawtransaction in_active_chain=False test
Diffstat (limited to 'src/rpc/rawtransaction.cpp')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 12 |
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; |