|
|
@ -811,33 +811,6 @@ UniValue estimatefee(const JSONRPCRequest& request)
|
|
|
|
return ValueFromAmount(feeRate.GetFeePerK());
|
|
|
|
return ValueFromAmount(feeRate.GetFeePerK());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UniValue estimatepriority(const JSONRPCRequest& request)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (request.fHelp || request.params.size() != 1)
|
|
|
|
|
|
|
|
throw runtime_error(
|
|
|
|
|
|
|
|
"estimatepriority nblocks\n"
|
|
|
|
|
|
|
|
"\nDEPRECATED. Estimates the approximate priority a zero-fee transaction needs to begin\n"
|
|
|
|
|
|
|
|
"confirmation within nblocks blocks.\n"
|
|
|
|
|
|
|
|
"\nArguments:\n"
|
|
|
|
|
|
|
|
"1. nblocks (numeric, required)\n"
|
|
|
|
|
|
|
|
"\nResult:\n"
|
|
|
|
|
|
|
|
"n (numeric) estimated priority\n"
|
|
|
|
|
|
|
|
"\n"
|
|
|
|
|
|
|
|
"A negative value is returned if not enough transactions and blocks\n"
|
|
|
|
|
|
|
|
"have been observed to make an estimate.\n"
|
|
|
|
|
|
|
|
"\nExample:\n"
|
|
|
|
|
|
|
|
+ HelpExampleCli("estimatepriority", "6")
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nBlocks = request.params[0].get_int();
|
|
|
|
|
|
|
|
if (nBlocks < 1)
|
|
|
|
|
|
|
|
nBlocks = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mempool.estimatePriority(nBlocks);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UniValue estimatesmartfee(const JSONRPCRequest& request)
|
|
|
|
UniValue estimatesmartfee(const JSONRPCRequest& request)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (request.fHelp || request.params.size() != 1)
|
|
|
|
if (request.fHelp || request.params.size() != 1)
|
|
|
@ -875,42 +848,6 @@ UniValue estimatesmartfee(const JSONRPCRequest& request)
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UniValue estimatesmartpriority(const JSONRPCRequest& request)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (request.fHelp || request.params.size() != 1)
|
|
|
|
|
|
|
|
throw runtime_error(
|
|
|
|
|
|
|
|
"estimatesmartpriority nblocks\n"
|
|
|
|
|
|
|
|
"\nDEPRECATED. WARNING: This interface is unstable and may disappear or change!\n"
|
|
|
|
|
|
|
|
"\nEstimates the approximate priority a zero-fee transaction needs to begin\n"
|
|
|
|
|
|
|
|
"confirmation within nblocks blocks if possible and return the number of blocks\n"
|
|
|
|
|
|
|
|
"for which the estimate is valid.\n"
|
|
|
|
|
|
|
|
"\nArguments:\n"
|
|
|
|
|
|
|
|
"1. nblocks (numeric, required)\n"
|
|
|
|
|
|
|
|
"\nResult:\n"
|
|
|
|
|
|
|
|
"{\n"
|
|
|
|
|
|
|
|
" \"priority\" : x.x, (numeric) estimated priority\n"
|
|
|
|
|
|
|
|
" \"blocks\" : n (numeric) block number where estimate was found\n"
|
|
|
|
|
|
|
|
"}\n"
|
|
|
|
|
|
|
|
"\n"
|
|
|
|
|
|
|
|
"A negative value is returned if not enough transactions and blocks\n"
|
|
|
|
|
|
|
|
"have been observed to make an estimate for any number of blocks.\n"
|
|
|
|
|
|
|
|
"However if the mempool reject fee is set it will return 1e9 * MAX_MONEY.\n"
|
|
|
|
|
|
|
|
"\nExample:\n"
|
|
|
|
|
|
|
|
+ HelpExampleCli("estimatesmartpriority", "6")
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int nBlocks = request.params[0].get_int();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UniValue result(UniValue::VOBJ);
|
|
|
|
|
|
|
|
int answerFound;
|
|
|
|
|
|
|
|
double priority = mempool.estimateSmartPriority(nBlocks, &answerFound);
|
|
|
|
|
|
|
|
result.push_back(Pair("priority", priority));
|
|
|
|
|
|
|
|
result.push_back(Pair("blocks", answerFound));
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const CRPCCommand commands[] =
|
|
|
|
static const CRPCCommand commands[] =
|
|
|
|
{ // category name actor (function) okSafeMode
|
|
|
|
{ // category name actor (function) okSafeMode
|
|
|
|
// --------------------- ------------------------ ----------------------- ----------
|
|
|
|
// --------------------- ------------------------ ----------------------- ----------
|
|
|
@ -924,9 +861,7 @@ static const CRPCCommand commands[] =
|
|
|
|
{ "generating", "generatetoaddress", &generatetoaddress, true, {"nblocks","address","maxtries"} },
|
|
|
|
{ "generating", "generatetoaddress", &generatetoaddress, true, {"nblocks","address","maxtries"} },
|
|
|
|
|
|
|
|
|
|
|
|
{ "util", "estimatefee", &estimatefee, true, {"nblocks"} },
|
|
|
|
{ "util", "estimatefee", &estimatefee, true, {"nblocks"} },
|
|
|
|
{ "util", "estimatepriority", &estimatepriority, true, {"nblocks"} },
|
|
|
|
|
|
|
|
{ "util", "estimatesmartfee", &estimatesmartfee, true, {"nblocks"} },
|
|
|
|
{ "util", "estimatesmartfee", &estimatesmartfee, true, {"nblocks"} },
|
|
|
|
{ "util", "estimatesmartpriority", &estimatesmartpriority, true, {"nblocks"} },
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void RegisterMiningRPCCommands(CRPCTable &t)
|
|
|
|
void RegisterMiningRPCCommands(CRPCTable &t)
|
|
|
|