X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcmining.cpp;h=fa0244242940e693d2efb3716d3518f0d02260ba;hb=15e9a03687e99d6b1a7a90e56e69a37faa6bb9b8;hp=71b47d4adf7026bfb1103158f9b9c6a8cba87a9b;hpb=749faf6d4decb3b364cc981060fd4a26dab82df8;p=novacoin.git diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 71b47d4..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)); @@ -78,7 +78,7 @@ Value scaninput(const Array& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( - "scaninput '{\"txid\":txid, \"vout\":[vout1, vout2, ..., voutN], \"difficulty\":difficulty, \"days\":days}'\n" + "scaninput '{\"txid\":\"txid\", \"vout\":[vout1, vout2, ..., voutN], \"difficulty\":difficulty, \"days\":days}'\n" "Scan specified transaction or input for suitable kernel solutions.\n" " difficulty - upper limit for difficulty, current difficulty by default;\n" " days - time window, 90 days by default.\n" @@ -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() ));