Skip to content

Commit c6f09c2

Browse files
author
John Newbery
committed
[rpc] remove deprecated estimatefee RPC
1 parent a8e437a commit c6f09c2

File tree

3 files changed

+5
-41
lines changed

3 files changed

+5
-41
lines changed

src/rpc/client.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
114114
{ "pruneblockchain", 0, "height" },
115115
{ "keypoolrefill", 0, "newsize" },
116116
{ "getrawmempool", 0, "verbose" },
117-
{ "estimatefee", 0, "nblocks" },
118117
{ "estimatesmartfee", 0, "conf_target" },
119118
{ "estimaterawfee", 0, "conf_target" },
120119
{ "estimaterawfee", 1, "threshold" },

src/rpc/mining.cpp

+3-38
Original file line numberDiff line numberDiff line change
@@ -772,43 +772,8 @@ UniValue submitblock(const JSONRPCRequest& request)
772772

773773
UniValue estimatefee(const JSONRPCRequest& request)
774774
{
775-
if (request.fHelp || request.params.size() != 1)
776-
throw std::runtime_error(
777-
"estimatefee nblocks\n"
778-
"\nDEPRECATED. Please use estimatesmartfee for more intelligent estimates."
779-
"\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
780-
"confirmation within nblocks blocks. Uses virtual transaction size of transaction\n"
781-
"as defined in BIP 141 (witness data is discounted).\n"
782-
"\nArguments:\n"
783-
"1. nblocks (numeric, required)\n"
784-
"\nResult:\n"
785-
"n (numeric) estimated fee-per-kilobyte\n"
786-
"\n"
787-
"A negative value is returned if not enough transactions and blocks\n"
788-
"have been observed to make an estimate.\n"
789-
"-1 is always returned for nblocks == 1 as it is impossible to calculate\n"
790-
"a fee that is high enough to get reliably included in the next block.\n"
791-
"\nExample:\n"
792-
+ HelpExampleCli("estimatefee", "6")
793-
);
794-
795-
if (!IsDeprecatedRPCEnabled("estimatefee")) {
796-
throw JSONRPCError(RPC_METHOD_DEPRECATED, "estimatefee is deprecated and will be fully removed in v0.17. "
797-
"To use estimatefee in v0.16, restart bitcoind with -deprecatedrpc=estimatefee.\n"
798-
"Projects should transition to using estimatesmartfee before upgrading to v0.17");
799-
}
800-
801-
RPCTypeCheck(request.params, {UniValue::VNUM});
802-
803-
int nBlocks = request.params[0].get_int();
804-
if (nBlocks < 1)
805-
nBlocks = 1;
806-
807-
CFeeRate feeRate = ::feeEstimator.estimateFee(nBlocks);
808-
if (feeRate == CFeeRate(0))
809-
return -1.0;
810-
811-
return ValueFromAmount(feeRate.GetFeePerK());
775+
throw JSONRPCError(RPC_METHOD_DEPRECATED, "estimatefee was removed in v0.17.\n"
776+
"Clients should use estimatesmartfee.");
812777
}
813778

814779
UniValue estimatesmartfee(const JSONRPCRequest& request)
@@ -986,7 +951,7 @@ static const CRPCCommand commands[] =
986951

987952
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
988953

989-
{ "util", "estimatefee", &estimatefee, {"nblocks"} },
954+
{ "hidden", "estimatefee", &estimatefee, {} },
990955
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
991956

992957
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },

src/wallet/rpcwallet.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3257,8 +3257,8 @@ UniValue bumpfee(const JSONRPCRequest& request)
32573257
"If the change output is not big enough to cover the increased fee, the command will currently fail\n"
32583258
"instead of adding new inputs to compensate. (A future implementation could improve this.)\n"
32593259
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
3260-
"By default, the new fee will be calculated automatically using estimatefee.\n"
3261-
"The user can specify a confirmation target for estimatefee.\n"
3260+
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
3261+
"The user can specify a confirmation target for estimatesmartfee.\n"
32623262
"Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n"
32633263
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
32643264
"returned by getnetworkinfo) to enter the node's mempool.\n"

0 commit comments

Comments
 (0)