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