"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));
{
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"
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<int>(boost::counting_iterator<int>( 0 ), boost::counting_iterator<int>( tx.vout.size() ));