Make DecodeHexTx return a CMutableTransaction

This commit is contained in:
Pieter Wuille
2016-11-30 14:50:20 -08:00
parent c3f5673a63
commit 42fd8dee30
6 changed files with 17 additions and 18 deletions

View File

@@ -520,13 +520,13 @@ UniValue decoderawtransaction(const JSONRPCRequest& request)
LOCK(cs_main);
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR));
CTransaction tx;
CMutableTransaction mtx;
if (!DecodeHexTx(tx, request.params[0].get_str(), true))
if (!DecodeHexTx(mtx, request.params[0].get_str(), true))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
UniValue result(UniValue::VOBJ);
TxToJSON(tx, uint256(), result);
TxToJSON(CTransaction(std::move(mtx)), uint256(), result);
return result;
}
@@ -883,9 +883,10 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR)(UniValue::VBOOL));
// parse hex string from parameter
CTransaction tx;
if (!DecodeHexTx(tx, request.params[0].get_str()))
CMutableTransaction mtx;
if (!DecodeHexTx(mtx, request.params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
CTransaction tx(std::move(mtx));
uint256 hashTx = tx.GetHash();
bool fLimitFree = false;