aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2017-08-10 15:58:25 -0700
committerAndrew Chow <achow101-github@achow101.com>2017-08-10 15:58:25 -0700
commite029c6e709d251809aa04edc08f76a077a2443e7 (patch)
treedd3edae6c43673ea81865bbb8ea3458627ef4677
parente526ca6284b9e13be1b912b80dd73a34e739b539 (diff)
Only return hex field once in getrawtransaction
The hex is already returned in TxToUniv, no need to give it out a second independent time in getrawtransaction itself.
-rw-r--r--src/rpc/rawtransaction.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index b967f2dbf8..ad6067db46 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -160,13 +160,10 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
: "No such mempool transaction. Use -txindex to enable blockchain transaction queries") +
". Use gettransaction for wallet transactions.");
- std::string strHex = EncodeHexTx(*tx, RPCSerializationFlags());
-
if (!fVerbose)
- return strHex;
+ return EncodeHexTx(*tx, RPCSerializationFlags());
UniValue result(UniValue::VOBJ);
- result.push_back(Pair("hex", strHex));
TxToJSON(*tx, hashBlock, result);
return result;
}