aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-11-30 14:50:20 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2016-12-02 18:28:22 -0800
commit42fd8dee302fec55ba0970e2f1378edc2797e4ff (patch)
tree0b2b5cb6be13f876f5b0fc6060da144213cda6bc /src/rpc
parentc3f5673a6304e3ea9fa56fff66b6ea1cb73cc98f (diff)
downloadbitcoin-42fd8dee302fec55ba0970e2f1378edc2797e4ff.tar.xz
Make DecodeHexTx return a CMutableTransaction
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 673979886a..48769a5335 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -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;