X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcmining.cpp;h=fa0244242940e693d2efb3716d3518f0d02260ba;hb=1ebe5b92ef18395cdae9b88fc38b0ed6166c3243;hp=498e1af8733278318b512c05f01aa43f199842e4;hpb=38663dc48fc85ff2cd44b2fcb5b246a928c04e1f;p=novacoin.git diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 498e1af..fa02442 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -50,7 +50,7 @@ Value getmininginfo(const Array& params, bool fHelp) "getmininginfo\n" "Returns an object containing mining-related information."); - Object obj, diff, weight; + Object obj, diff; obj.push_back(Pair("blocks", (int)nBestHeight)); obj.push_back(Pair("currentblocksize",(uint64_t)nLastBlockSize)); obj.push_back(Pair("currentblocktx",(uint64_t)nLastBlockTx)); @@ -147,6 +147,18 @@ Value scaninput(const Array& params, bool fHelp) vInputs.push_back(nOut); } } + else if(inputs_v.type() == int_type) + { + int nOut = inputs_v.get_int(); + if (nOut < 0 || nOut > (int)tx.vout.size() - 1) + { + stringstream strErrorMsg; + strErrorMsg << boost::format("Invalid parameter, input number %d is out of range") % nOut; + throw JSONRPCError(RPC_INVALID_PARAMETER, strErrorMsg.str()); + } + + vInputs.push_back(nOut); + } else { vInputs = vector(boost::counting_iterator( 0 ), boost::counting_iterator( tx.vout.size() ));