diff options
| author | John Newbery <[email protected]> | 2018-02-02 10:09:04 -0500 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2018-02-05 15:17:31 -0500 |
| commit | c6f09c2713333bf335e83bb303e2feec10136751 (patch) | |
| tree | 2187caea2bd1dd987717193fe03dd22422055d95 /src/rpc/mining.cpp | |
| parent | [tests] Remove estimatefee from rpc_deprecated.py test (diff) | |
| download | discoin-c6f09c2713333bf335e83bb303e2feec10136751.tar.xz discoin-c6f09c2713333bf335e83bb303e2feec10136751.zip | |
[rpc] remove deprecated estimatefee RPC
Diffstat (limited to 'src/rpc/mining.cpp')
| -rw-r--r-- | src/rpc/mining.cpp | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c22d0ac37..6c36c0601 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -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"} }, |