Skip to content

Commit 3843780

Browse files
committed
Merge #12336: Remove deprecated rpc options
db1cbcc [RPC] Remove deprecated addmultisigaddress return format (John Newbery) cb28a0b [RPC] Remove deprecated createmultisig object (John Newbery) ed45c82 [tests] Remove test for deprecated createmultsig option (John Newbery) d066a1c [rpc] Remove deprecated getmininginfo RPC option (John Newbery) c6f09c2 [rpc] remove deprecated estimatefee RPC (John Newbery) a8e437a [tests] Remove estimatefee from rpc_deprecated.py test (John Newbery) a5623b1 [tests] Remove tests for deprecated estimatefee RPC (John Newbery) d119f2e [tests] Fix style warnings in feature_fee_estimation.py (John Newbery) Pull request description: There were some RPC/RPC options deprecated in v0.16. Those can now be removed from master since v0.16 has been branched. - `estimatefee` RPC has been removed. The `feature_fee_estimation.py` test has been updated to remove the RPC, but doesn't yet have good coverage of the replacement RPC `estimatesmartfee`. Improving the test coverage should be done in a new PR. (#11031) - the `errors` field returned by `getmininginfo` has been deprecated and replaced by a `warning` field. (#10858) - providing addresses as inputs to `createmultisig` has been deprecated. Users should use `addmultisigaddress` instead (#11415) - The return format from `addmultisigaddress` has changed (#11415) `getwitnessaddress` was also deprecated in v0.16 and can be removed, but many tests are using that RPC, so it's a larger job to remove. It should be removed in a separate PR (possibly after #11739 and #11398 have been merged and the segwit test code tidied up) Tree-SHA512: 8ffaa5f6094131339b9e9e468e8b141de4b144697d2271efa2992b80b12eb97849ade3da8df5c1c9400ed4c04e6a029926550a3e5846d2029b644f9e84ac7124
2 parents b264528 + db1cbcc commit 3843780

File tree

6 files changed

+87
-170
lines changed

6 files changed

+87
-170
lines changed

src/rpc/client.cpp

Lines changed: 0 additions & 1 deletion
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

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ UniValue getmininginfo(const JSONRPCRequest& request)
201201
" \"pooledtx\": n (numeric) The size of the mempool\n"
202202
" \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n"
203203
" \"warnings\": \"...\" (string) any network and blockchain warnings\n"
204-
" \"errors\": \"...\" (string) DEPRECATED. Same as warnings. Only shown when bitcoind is started with -deprecatedrpc=getmininginfo\n"
205204
"}\n"
206205
"\nExamples:\n"
207206
+ HelpExampleCli("getmininginfo", "")
@@ -219,11 +218,7 @@ UniValue getmininginfo(const JSONRPCRequest& request)
219218
obj.push_back(Pair("networkhashps", getnetworkhashps(request)));
220219
obj.push_back(Pair("pooledtx", (uint64_t)mempool.size()));
221220
obj.push_back(Pair("chain", Params().NetworkIDString()));
222-
if (IsDeprecatedRPCEnabled("getmininginfo")) {
223-
obj.push_back(Pair("errors", GetWarnings("statusbar")));
224-
} else {
225-
obj.push_back(Pair("warnings", GetWarnings("statusbar")));
226-
}
221+
obj.push_back(Pair("warnings", GetWarnings("statusbar")));
227222
return obj;
228223
}
229224

@@ -772,43 +767,8 @@ UniValue submitblock(const JSONRPCRequest& request)
772767

773768
UniValue estimatefee(const JSONRPCRequest& request)
774769
{
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());
770+
throw JSONRPCError(RPC_METHOD_DEPRECATED, "estimatefee was removed in v0.17.\n"
771+
"Clients should use estimatesmartfee.");
812772
}
813773

814774
UniValue estimatesmartfee(const JSONRPCRequest& request)
@@ -986,7 +946,7 @@ static const CRPCCommand commands[] =
986946

987947
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
988948

989-
{ "util", "estimatefee", &estimatefee, {"nblocks"} },
949+
{ "hidden", "estimatefee", &estimatefee, {} },
990950
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
991951

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

src/rpc/misc.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ UniValue createmultisig(const JSONRPCRequest& request)
262262
std::string msg = "createmultisig nrequired [\"key\",...]\n"
263263
"\nCreates a multi-signature address with n signature of m keys required.\n"
264264
"It returns a json object with the address and redeemScript.\n"
265-
"DEPRECATION WARNING: Using addresses with createmultisig is deprecated. Clients must\n"
266-
"transition to using addmultisigaddress to create multisig addresses with addresses known\n"
267-
"to the wallet before upgrading to v0.17. To use the deprecated functionality, start bitcoind with -deprecatedrpc=createmultisig\n"
268265
"\nArguments:\n"
269266
"1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n"
270267
"2. \"keys\" (string, required) A json array of hex-encoded public keys\n"
@@ -297,15 +294,8 @@ UniValue createmultisig(const JSONRPCRequest& request)
297294
if (IsHex(keys[i].get_str()) && (keys[i].get_str().length() == 66 || keys[i].get_str().length() == 130)) {
298295
pubkeys.push_back(HexToPubKey(keys[i].get_str()));
299296
} else {
300-
#ifdef ENABLE_WALLET
301-
CWallet* const pwallet = GetWalletForJSONRPCRequest(request);
302-
if (IsDeprecatedRPCEnabled("createmultisig") && EnsureWalletIsAvailable(pwallet, false)) {
303-
pubkeys.push_back(AddrToPubKey(pwallet, keys[i].get_str()));
304-
} else
305-
#endif
306297
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid public key: %s\nNote that from v0.16, createmultisig no longer accepts addresses."
307-
" Clients must transition to using addmultisigaddress to create multisig addresses with addresses known to the wallet before upgrading to v0.17."
308-
" To use the deprecated functionality, start bitcoind with -deprecatedrpc=createmultisig", keys[i].get_str()));
298+
" Users must use addmultisigaddress to create multisig addresses with addresses known to the wallet.", keys[i].get_str()));
309299
}
310300
}
311301

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,10 +1192,6 @@ UniValue addmultisigaddress(const JSONRPCRequest& request)
11921192
" \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n"
11931193
" \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n"
11941194
"}\n"
1195-
"\nResult (DEPRECATED. To see this result in v0.16 instead, please start bitcoind with -deprecatedrpc=addmultisigaddress).\n"
1196-
" clients should transition to the new output api before upgrading to v0.17.\n"
1197-
"\"address\" (string) A bitcoin address associated with the keys.\n"
1198-
11991195
"\nExamples:\n"
12001196
"\nAdd a multisig address from 2 addresses\n"
12011197
+ HelpExampleCli("addmultisigaddress", "2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
@@ -1238,11 +1234,6 @@ UniValue addmultisigaddress(const JSONRPCRequest& request)
12381234
CTxDestination dest = pwallet->AddAndGetDestinationForScript(inner, output_type);
12391235
pwallet->SetAddressBook(dest, strAccount, "send");
12401236

1241-
// Return old style interface
1242-
if (IsDeprecatedRPCEnabled("addmultisigaddress")) {
1243-
return EncodeDestination(dest);
1244-
}
1245-
12461237
UniValue result(UniValue::VOBJ);
12471238
result.pushKV("address", EncodeDestination(dest));
12481239
result.pushKV("redeemScript", HexStr(inner.begin(), inner.end()));
@@ -3260,8 +3251,8 @@ UniValue bumpfee(const JSONRPCRequest& request)
32603251
"If the change output is not big enough to cover the increased fee, the command will currently fail\n"
32613252
"instead of adding new inputs to compensate. (A future implementation could improve this.)\n"
32623253
"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\n"
3263-
"By default, the new fee will be calculated automatically using estimatefee.\n"
3264-
"The user can specify a confirmation target for estimatefee.\n"
3254+
"By default, the new fee will be calculated automatically using estimatesmartfee.\n"
3255+
"The user can specify a confirmation target for estimatesmartfee.\n"
32653256
"Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\n"
32663257
"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\n"
32673258
"returned by getnetworkinfo) to enter the node's mempool.\n"

0 commit comments

Comments
 (0)