@@ -520,13 +520,13 @@ UniValue decoderawtransaction(const JSONRPCRequest& request)
520520 LOCK (cs_main);
521521 RPCTypeCheck (request.params , boost::assign::list_of (UniValue::VSTR));
522522
523- CTransaction tx ;
523+ CMutableTransaction mtx ;
524524
525- if (!DecodeHexTx (tx , request.params [0 ].get_str (), true ))
525+ if (!DecodeHexTx (mtx , request.params [0 ].get_str (), true ))
526526 throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
527527
528528 UniValue result (UniValue::VOBJ);
529- TxToJSON (tx , uint256 (), result);
529+ TxToJSON (CTransaction ( std::move (mtx)) , uint256 (), result);
530530
531531 return result;
532532}
@@ -883,9 +883,10 @@ UniValue sendrawtransaction(const JSONRPCRequest& request)
883883 RPCTypeCheck (request.params , boost::assign::list_of (UniValue::VSTR)(UniValue::VBOOL));
884884
885885 // parse hex string from parameter
886- CTransaction tx ;
887- if (!DecodeHexTx (tx , request.params [0 ].get_str ()))
886+ CMutableTransaction mtx ;
887+ if (!DecodeHexTx (mtx , request.params [0 ].get_str ()))
888888 throw JSONRPCError (RPC_DESERIALIZATION_ERROR, " TX decode failed" );
889+ CTransaction tx (std::move (mtx));
889890 uint256 hashTx = tx.GetHash ();
890891
891892 bool fLimitFree = false ;
0 commit comments