[rpc] remove deprecated estimatefee RPC
This commit is contained in:
parent
a8e437a02f
commit
c6f09c2713
3 changed files with 5 additions and 41 deletions
|
@ -114,7 +114,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
|||
{ "pruneblockchain", 0, "height" },
|
||||
{ "keypoolrefill", 0, "newsize" },
|
||||
{ "getrawmempool", 0, "verbose" },
|
||||
{ "estimatefee", 0, "nblocks" },
|
||||
{ "estimatesmartfee", 0, "conf_target" },
|
||||
{ "estimaterawfee", 0, "conf_target" },
|
||||
{ "estimaterawfee", 1, "threshold" },
|
||||
|
|
|
@ -772,43 +772,8 @@ UniValue submitblock(const JSONRPCRequest& request)
|
|||
|
||||
UniValue estimatefee(const JSONRPCRequest& request)
|
||||
{
|
||||
if (request.fHelp || request.params.size() != 1)
|
||||
throw std::runtime_error(
|
||||
"estimatefee nblocks\n"
|
||||
"\nDEPRECATED. Please use estimatesmartfee for more intelligent estimates."
|
||||
"\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
|
||||
"confirmation within nblocks blocks. Uses virtual transaction size of transaction\n"
|
||||
"as defined in BIP 141 (witness data is discounted).\n"
|
||||
"\nArguments:\n"
|
||||
"1. nblocks (numeric, required)\n"
|
||||
"\nResult:\n"
|
||||
"n (numeric) estimated fee-per-kilobyte\n"
|
||||
"\n"
|
||||
"A negative value is returned if not enough transactions and blocks\n"
|
||||
"have been observed to make an estimate.\n"
|
||||
"-1 is always returned for nblocks == 1 as it is impossible to calculate\n"
|
||||
"a fee that is high enough to get reliably included in the next block.\n"
|
||||
"\nExample:\n"
|
||||
+ HelpExampleCli("estimatefee", "6")
|
||||
);
|
||||
|
||||
if (!IsDeprecatedRPCEnabled("estimatefee")) {
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "estimatefee is deprecated and will be fully removed in v0.17. "
|
||||
"To use estimatefee in v0.16, restart bitcoind with -deprecatedrpc=estimatefee.\n"
|
||||
"Projects should transition to using estimatesmartfee before upgrading to v0.17");
|
||||
}
|
||||
|
||||
RPCTypeCheck(request.params, {UniValue::VNUM});
|
||||
|
||||
int nBlocks = request.params[0].get_int();
|
||||
if (nBlocks < 1)
|
||||
nBlocks = 1;
|
||||
|
||||
CFeeRate feeRate = ::feeEstimator.estimateFee(nBlocks);
|
||||
if (feeRate == CFeeRate(0))
|
||||
return -1.0;
|
||||
|
||||
return ValueFromAmount(feeRate.GetFeePerK());
|
||||
throw JSONRPCError(RPC_METHOD_DEPRECATED, "estimatefee was removed in v0.17.\n"
|
||||
"Clients should use estimatesmartfee.");
|
||||
}
|
||||
|
||||
UniValue estimatesmartfee(const JSONRPCRequest& request)
|
||||
|
@ -986,7 +951,7 @@ static const CRPCCommand commands[] =
|
|||
|
||||
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
|
||||
|
||||
{ "util", "estimatefee", &estimatefee, {"nblocks"} },
|
||||
{ "hidden", "estimatefee", &estimatefee, {} },
|
||||
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
|
||||
|
||||
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
|
||||
|
|
|
@ -3257,8 +3257,8 @@ UniValue bumpfee(const JSONRPCRequest& request)
|
|||
"If the change output is not big enough to cover the increased fee, the command will currently fail\n"
|
||||
"instead of adding new inputs to compensate. (A future implementation could improve this.)\n"
|
||||
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
|
||||
"By default, the new fee will be calculated automatically using estimatefee.\n"
|
||||
"The user can specify a confirmation target for estimatefee.\n"
|
||||
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
|
||||
"The user can specify a confirmation target for estimatesmartfee.\n"
|
||||
"Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n"
|
||||
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
|
||||
"returned by getnetworkinfo) to enter the node's mempool.\n"
|
||||
|
|
Loading…
Reference in a new issue