Skip to content

Commit

Permalink
Only return hex field once in getrawtransaction
Browse files Browse the repository at this point in the history
The hex is already returned in TxToUniv, no need to give it out a
second independent time in getrawtransaction itself.
  • Loading branch information
achow101 committed Aug 10, 2017
1 parent e526ca6 commit e029c6e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit e029c6e

Please sign in to comment.