Skip to content

Commit e029c6e

Browse files
committed
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.
1 parent e526ca6 commit e029c6e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,10 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
160160
: "No such mempool transaction. Use -txindex to enable blockchain transaction queries") +
161161
". Use gettransaction for wallet transactions.");
162162

163-
std::string strHex = EncodeHexTx(*tx, RPCSerializationFlags());
164-
165163
if (!fVerbose)
166-
return strHex;
164+
return EncodeHexTx(*tx, RPCSerializationFlags());
167165

168166
UniValue result(UniValue::VOBJ);
169-
result.push_back(Pair("hex", strHex));
170167
TxToJSON(*tx, hashBlock, result);
171168
return result;
172169
}

0 commit comments

Comments
 (0)