mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Make DecodeHexTx return a CMutableTransaction
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user