extend conversion to UniValue

This commit is contained in:
Jonas Schnelli
2015-05-10 13:35:44 +02:00
committed by Jack Grigg
parent ed21d5bd4b
commit 9756b7bd29
13 changed files with 76 additions and 69 deletions

View File

@@ -306,7 +306,8 @@ Value gettxoutproof(const Array& params, bool fHelp)
set<uint256> setTxids;
uint256 oneTxid;
Array txids = params[0].get_array();
BOOST_FOREACH(Value& txid, txids) {
for (unsigned int idx = 0; idx < txids.size(); idx++) {
const Value& txid = txids[idx];
if (txid.get_str().length() != 64 || !IsHex(txid.get_str()))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid txid ")+txid.get_str());
uint256 hash(uint256S(txid.get_str()));
@@ -559,7 +560,7 @@ Value decoderawtransaction(const Array& params, bool fHelp)
if (!DecodeHexTx(tx, params[0].get_str()))
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
Object result;
UniValue result(UniValue::VOBJ);
TxToJSON(tx, uint256(), result);
return result;
@@ -591,7 +592,7 @@ Value decodescript(const Array& params, bool fHelp)
);
LOCK(cs_main);
RPCTypeCheck(params, boost::assign::list_of(str_type));
RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR));
Object r;
CScript script;