diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -80,8 +80,8 @@ _("This command requires JSON registers:") + _("prevtxs=JSON object") + ", " + _("privatekeys=JSON object") + ". " + - _("See signrawtransaction docs for format of sighash " - "flags, JSON objects."), + _("See signrawtransactionwithkey docs for format of " + "sighash flags, JSON objects."), false, OptionsCategory::COMMANDS); gArgs.AddArg("load=NAME:FILENAME", diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -67,7 +67,6 @@ const QStringList historyFilter = QStringList() << "importprivkey" << "importmulti" << "signmessagewithprivkey" - << "signrawtransaction" << "signrawtransactionwithkey" << "walletpassphrase" << "walletpassphrasechange" diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -204,16 +204,6 @@ updateFeeSectionControls(); updateMinFeeLabel(); updateSmartFeeLabel(); - - // Cleanup old confirmation target related settings - // TODO: Remove these in 0.20 - QSettings settings; - if (settings.value("nSmartFeeSliderPosition").toInt() != 0) { - settings.remove("nSmartFeeSliderPosition"); - } - if (settings.value("nConfTarget").toInt() != 0) { - settings.remove("nConfTarget"); - } } } diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1241,39 +1241,6 @@ nCheckDepth); } -/** Implementation of IsSuperMajority with better feedback */ -static UniValue SoftForkMajorityDesc(int version, const CBlockIndex *pindex, - const Consensus::Params &consensusParams) { - UniValue rv(UniValue::VOBJ); - bool activated = false; - switch (version) { - case 2: - activated = pindex->nHeight >= consensusParams.BIP34Height; - break; - case 3: - activated = pindex->nHeight >= consensusParams.BIP66Height; - break; - case 4: - activated = pindex->nHeight >= consensusParams.BIP65Height; - break; - case 5: - activated = pindex->nHeight >= consensusParams.CSVHeight; - break; - } - rv.pushKV("status", activated); - return rv; -} - -static UniValue SoftForkDesc(const std::string &name, int version, - const CBlockIndex *pindex, - const Consensus::Params &consensusParams) { - UniValue rv(UniValue::VOBJ); - rv.pushKV("id", name); - rv.pushKV("version", version); - rv.pushKV("reject", SoftForkMajorityDesc(version, pindex, consensusParams)); - return rv; -} - UniValue getblockchaininfo(const Config &config, const JSONRPCRequest &request) { if (request.fHelp || request.params.size() != 0) { @@ -1281,11 +1248,6 @@ "getblockchaininfo\n" "Returns an object containing various state info regarding " "blockchain processing.\n" - "DEPRECATION WARNING: The 'softforks' output has been deprecated " - "and will be\n" - "removed v0.20. For the time being it will only be shown here when " - "bitcoind\n" - "is started with -deprecatedrpc=getblockchaininfo.\n" "\nResult:\n" "{\n" " \"chain\": \"xxxx\", (string) current network name " @@ -1316,18 +1278,6 @@ "pruning is enabled (only present if pruning is enabled)\n" " \"prune_target_size\": xxxxxx, (numeric) the target size " "used by pruning (only present if automatic pruning is enabled)\n" - " \"softforks\": [ (array) DEPRECATED: status of " - "softforks in progress\n" - " {\n" - " \"id\": \"xxxx\", (string) name of softfork\n" - " \"version\": xx, (numeric) block version\n" - " \"reject\": { (object) progress toward " - "rejecting pre-softfork blocks\n" - " \"status\": xx, (boolean) true if threshold " - "reached\n" - " },\n" - " }, ...\n" - " ]\n" " \"warnings\" : \"...\", (string) any network and " "blockchain warnings.\n" "}\n" @@ -1370,17 +1320,6 @@ } } - if (IsDeprecatedRPCEnabled(gArgs, "getblockchaininfo")) { - const Consensus::Params &consensusParams = - config.GetChainParams().GetConsensus(); - UniValue softforks(UniValue::VARR); - softforks.push_back(SoftForkDesc("bip34", 2, tip, consensusParams)); - softforks.push_back(SoftForkDesc("bip66", 3, tip, consensusParams)); - softforks.push_back(SoftForkDesc("bip65", 4, tip, consensusParams)); - softforks.push_back(SoftForkDesc("csv", 5, tip, consensusParams)); - obj.pushKV("softforks", softforks); - } - obj.pushKV("warnings", GetWarnings("statusbar")); return obj; } diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -91,8 +91,6 @@ {"createrawtransaction", 0, "inputs"}, {"createrawtransaction", 1, "outputs"}, {"createrawtransaction", 2, "locktime"}, - {"signrawtransaction", 1, "prevtxs"}, - {"signrawtransaction", 2, "privkeys"}, {"signrawtransactionwithkey", 1, "privkeys"}, {"signrawtransactionwithkey", 2, "prevtxs"}, {"signrawtransactionwithwallet", 1, "prevtxs"}, diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -239,9 +239,6 @@ "defined in BIP70 (main, test, regtest)\n" " \"warnings\": \"...\" (string) any network and " "blockchain warnings\n" - " \"errors\": \"...\" (string) DEPRECATED. Same as " - "warnings. Only shown when bitcoind is started with " - "-deprecatedrpc=getmininginfo\n" "}\n" "\nExamples:\n" + HelpExampleCli("getmininginfo", "") + @@ -261,11 +258,8 @@ obj.pushKV("networkhashps", getnetworkhashps(config, request)); obj.pushKV("pooledtx", uint64_t(g_mempool.size())); obj.pushKV("chain", config.GetChainParams().NetworkIDString()); - if (IsDeprecatedRPCEnabled(gArgs, "getmininginfo")) { - obj.pushKV("errors", GetWarnings("statusbar")); - } else { - obj.pushKV("warnings", GetWarnings("statusbar")); - } + obj.pushKV("warnings", GetWarnings("statusbar")); + return obj; } @@ -763,7 +757,7 @@ static UniValue estimatefee(const Config &config, const JSONRPCRequest &request) { - if (request.fHelp || request.params.size() > 1) { + if (request.fHelp || request.params.size() > 0) { throw std::runtime_error( "estimatefee\n" "\nEstimates the approximate fee per kilobyte needed for a " @@ -774,17 +768,6 @@ HelpExampleCli("estimatefee", "")); } - if ((request.params.size() == 1) && - !IsDeprecatedRPCEnabled(gArgs, "estimatefee")) { - // FIXME: Remove this message in 0.20 - throw JSONRPCError( - RPC_METHOD_DEPRECATED, - "estimatefee with the nblocks argument is no longer supported\n" - "Please call estimatefee with no arguments instead.\n" - "\nExample:\n" + - HelpExampleCli("estimatefee", "")); - } - return ValueFromAmount(g_mempool.estimateFee().GetFeePerK()); } diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -39,14 +39,6 @@ throw std::runtime_error( "validateaddress \"address\"\n" "\nReturn information about the given bitcoin address.\n" - "DEPRECATION WARNING: Parts of this command have been deprecated " - "and moved to getaddressinfo. Clients must\n" - "transition to using getaddressinfo to access this information " - "before upgrading to v0.20. The following deprecated\n" - "fields have moved to getaddressinfo and will only be shown here " - "with -deprecatedrpc=validateaddress: ismine, iswatchonly,\n" - "script, hex, pubkeys, sigsrequired, pubkey, addresses, embedded, " - "iscompressed, account, timestamp, hdkeypath, kdmasterkeyid.\n" "\nArguments:\n" "1. \"address\" (string, required) The bitcoin " "address to validate\n" @@ -76,11 +68,6 @@ ret.pushKV("isvalid", isValid); if (isValid) { -#ifdef ENABLE_WALLET - if (HasWallets() && IsDeprecatedRPCEnabled(gArgs, "validateaddress")) { - ret.pushKVs(getaddressinfo(config, request)); - } -#endif if (ret["address"].isNull()) { std::string currentAddress = EncodeDestination(dest, config); ret.pushKV("address", currentAddress); @@ -108,12 +95,6 @@ "\nCreates a multi-signature address with n signature of m keys " "required.\n" "It returns a json object with the address and redeemScript.\n" - "DEPRECATION WARNING: Using addresses with createmultisig is " - "deprecated. Clients must\n" - "transition to using addmultisigaddress to create multisig " - "addresses with addresses known\n" - "to the wallet before upgrading to v0.20. To use the deprecated " - "functionality, start bitcoind with -deprecatedrpc=createmultisig\n" "\nArguments:\n" "1. nrequired (numeric, required) The number of required " "signatures out of the n keys or addresses.\n" @@ -162,25 +143,9 @@ keys[i].get_str().length() == 130)) { pubkeys.push_back(HexToPubKey(keys[i].get_str())); } else { -#ifdef ENABLE_WALLET - CWallet *const pwallet = GetWalletForJSONRPCRequest(request); - if (IsDeprecatedRPCEnabled(gArgs, "createmultisig") && - EnsureWalletIsAvailable(pwallet, false)) { - pubkeys.push_back(AddrToPubKey(config.GetChainParams(), pwallet, - keys[i].get_str())); - } else -#endif - throw JSONRPCError( - RPC_INVALID_ADDRESS_OR_KEY, - strprintf("Invalid public key: %s\nNote that from v0.19.6, " - "createmultisig no longer accepts addresses." - " Clients must transition to using " - "addmultisigaddress to create multisig addresses " - "with addresses known to the wallet before " - "upgrading to v0.20." - " To use the deprecated functionality, start " - "bitcoind with -deprecatedrpc=createmultisig", - keys[i].get_str())); + throw JSONRPCError( + RPC_INVALID_ADDRESS_OR_KEY, + strprintf("Invalid public key: %s\n", keys[i].get_str())); } } diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1130,145 +1130,6 @@ request.params[3]); } -static UniValue signrawtransaction(const Config &config, - const JSONRPCRequest &request) { -#ifdef ENABLE_WALLET - CWallet *const pwallet = GetWalletForJSONRPCRequest(request); -#endif - - if (request.fHelp || request.params.size() < 1 || - request.params.size() > 4) { - throw std::runtime_error( - "signrawtransaction \"hexstring\" ( " - "[{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\"," - "\"redeemScript\":\"hex\"},...] [\"privatekey1\",...] sighashtype " - ")\n" - "\nDEPRECATED.Sign inputs for raw transaction (serialized, " - "hex-encoded).\n" - "The second optional argument (may be null) is an array of " - "previous transaction outputs that\n" - "this transaction depends on but may not yet be in the block " - "chain.\n" - "The third optional argument (may be null) is an array of " - "base58-encoded private\n" - "keys that, if given, will be the only keys used to sign the " - "transaction.\n" -#ifdef ENABLE_WALLET - + HelpRequiringPassphrase(pwallet) + - "\n" -#endif - "\nArguments:\n" - "1. \"hexstring\" (string, required) The transaction hex " - "string\n" - "2. \"prevtxs\" (string, optional) An json array of previous " - "dependent transaction outputs\n" - " [ (json array of json objects, or 'null' if " - "none provided)\n" - " {\n" - " \"txid\":\"id\", (string, required) The " - "transaction id\n" - " \"vout\":n, (numeric, required) The " - "output number\n" - " \"scriptPubKey\": \"hex\", (string, required) script " - "key\n" - " \"redeemScript\": \"hex\", (string, required for P2SH) " - "redeem script\n" - " \"amount\": value (numeric, required) The " - "amount spent\n" - " }\n" - " ,...\n" - " ]\n" - "3. \"privkeys\" (string, optional) A json array of " - "base58-encoded private keys for signing\n" - " [ (json array of strings, or 'null' if none " - "provided)\n" - " \"privatekey\" (string) private key in base58-encoding\n" - " ,...\n" - " ]\n" - "4. \"sighashtype\" (string, optional, default=ALL) The " - "signature hash type. Must be one of\n" - " \"ALL|FORKID\"\n" - " \"NONE|FORKID\"\n" - " \"SINGLE|FORKID\"\n" - " \"ALL|FORKID|ANYONECANPAY\"\n" - " \"NONE|FORKID|ANYONECANPAY\"\n" - " \"SINGLE|FORKID|ANYONECANPAY\"\n" - - "\nResult:\n" - "{\n" - " \"hex\" : \"value\", (string) The hex-encoded raw " - "transaction with signature(s)\n" - " \"complete\" : true|false, (boolean) If the transaction has a " - "complete set of signatures\n" - " \"errors\" : [ (json array of objects) Script " - "verification errors (if there are any)\n" - " {\n" - " \"txid\" : \"hash\", (string) The hash of the " - "referenced, previous transaction\n" - " \"vout\" : n, (numeric) The index of the " - "output to spent and used as input\n" - " \"scriptSig\" : \"hex\", (string) The hex-encoded " - "signature script\n" - " \"sequence\" : n, (numeric) Script sequence " - "number\n" - " \"error\" : \"text\" (string) Verification or " - "signing error related to the input\n" - " }\n" - " ,...\n" - " ]\n" - "}\n" - - "\nExamples:\n" + - HelpExampleCli("signrawtransaction", "\"myhex\"") + - HelpExampleRpc("signrawtransaction", "\"myhex\"")); - } - - if (!IsDeprecatedRPCEnabled(gArgs, "signrawtransaction")) { - throw JSONRPCError( - RPC_METHOD_DEPRECATED, - "signrawtransaction is deprecated and will be fully removed in " - "v0.20. " - "To use signrawtransaction in v0.19, restart bitcoind with " - "-deprecatedrpc=signrawtransaction.\n" - "Projects should transition to using signrawtransactionwithkey and " - "signrawtransactionwithwallet before upgrading to v0.20"); - } - - RPCTypeCheck( - request.params, - {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true); - - // Make a JSONRPCRequest to pass on to the right signrawtransaction* command - JSONRPCRequest new_request; - new_request.id = request.id; - new_request.URI = std::move(request.URI); - new_request.params.setArray(); - - // For signing with private keys - if (!request.params[2].isNull()) { - new_request.params.push_back(request.params[0]); - // Note: the prevtxs and privkeys are reversed for - // signrawtransactionwithkey - new_request.params.push_back(request.params[2]); - new_request.params.push_back(request.params[1]); - new_request.params.push_back(request.params[3]); - return signrawtransactionwithkey(config, new_request); - } else { -#ifdef ENABLE_WALLET - // Otherwise sign with the wallet which does not take a privkeys - // parameter - new_request.params.push_back(request.params[0]); - new_request.params.push_back(request.params[1]); - new_request.params.push_back(request.params[3]); - return signrawtransactionwithwallet(config, new_request); -#else - // If we have made it this far, then wallet is disabled and no private - // keys were given, so fail here. - throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available."); -#endif - } -} - static UniValue sendrawtransaction(const Config &config, const JSONRPCRequest &request) { if (request.fHelp || request.params.size() < 1 || @@ -1277,7 +1138,8 @@ "sendrawtransaction \"hexstring\" ( allowhighfees )\n" "\nSubmits raw transaction (serialized, hex-encoded) to local node " "and network.\n" - "\nAlso see createrawtransaction and signrawtransaction calls.\n" + "\nAlso see createrawtransaction and signrawtransactionwithkey " + "calls.\n" "\nArguments:\n" "1. \"hexstring\" (string, required) The hex string of the raw " "transaction)\n" @@ -1292,7 +1154,7 @@ "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" " "\"{\\\"myaddress\\\":0.01}\"") + "Sign the transaction, and get back the hex\n" + - HelpExampleCli("signrawtransaction", "\"myhex\"") + + HelpExampleCli("signrawtransactionwithwallet", "\"myhex\"") + "\nSend the transaction (signed hex)\n" + HelpExampleCli("sendrawtransaction", "\"signedhex\"") + "\nAs a json rpc call\n" + @@ -1407,7 +1269,7 @@ "\nCreate a transaction\n" + HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") + "Sign the transaction, and get back the hex\n" - + HelpExampleCli("signrawtransaction", "\"myhex\"") + + + HelpExampleCli("signrawtransactionwithwallet", "\"myhex\"") + "\nTest acceptance of the transaction (signed hex)\n" + HelpExampleCli("testmempoolaccept", "\"signedhex\"") + "\nAs a json rpc call\n" @@ -1477,7 +1339,6 @@ { "rawtransactions", "decodescript", decodescript, {"hexstring"} }, { "rawtransactions", "sendrawtransaction", sendrawtransaction, {"hexstring","allowhighfees"} }, { "rawtransactions", "combinerawtransaction", combinerawtransaction, {"txs"} }, - { "rawtransactions", "signrawtransaction", signrawtransaction, {"hexstring","prevtxs","privkeys","sighashtype"} }, /* uses wallet if enabled */ { "rawtransactions", "signrawtransactionwithkey", signrawtransactionwithkey, {"hexstring","privkeys","prevtxs","sighashtype"} }, { "rawtransactions", "testmempoolaccept", testmempoolaccept, {"rawtxs","allowhighfees"} }, diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -795,8 +795,9 @@ * This allows transaction replacement to work as expected, as you want to * have all inputs "available" to check signatures, and any cycles in the * dependency graph are checked directly in AcceptToMemoryPool. - * It also allows you to sign a double-spend directly in signrawtransaction, - * as long as the conflicting transaction is not yet confirmed. + * It also allows you to sign a double-spend directly in + * signrawtransactionwithkey and signrawtransactionwithwallet, as long as the + * conflicting transaction is not yet confirmed. */ class CCoinsViewMemPool : public CCoinsViewBacked { protected: diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1414,12 +1414,6 @@ " \"redeemScript\":\"script\" (string) The string value " "of the hex-encoded redemption script.\n" "}\n" - "\nResult (DEPRECATED. To see this result in v0.19.6 instead, " - "please start bitcoind with -deprecatedrpc=addmultisigaddress).\n" - " clients should transition to the new output api before " - "upgrading to v0.20.\n" - "\"address\" (string) A bitcoin address " - "associated with the keys.\n" "\nExamples:\n" "\nAdd a multisig address from 2 addresses\n" + @@ -1469,11 +1463,6 @@ pwallet->SetAddressBook(dest, label, "send"); - // Return old style interface - if (IsDeprecatedRPCEnabled(gArgs, "addmultisigaddress")) { - return EncodeDestination(dest, config); - } - UniValue result(UniValue::VOBJ); result.pushKV("address", EncodeDestination(dest, config)); result.pushKV("redeemScript", HexStr(inner.begin(), inner.end())); @@ -3627,7 +3616,8 @@ "\"subtractFeeFromOutputs\" is specified.\n" "Note that inputs which were signed may need to be resigned after " "completion since in/outputs have been added.\n" - "The inputs added will not be signed, use signrawtransaction for " + "The inputs added will not be signed, use " + "signrawtransactionwithkey or signrawtransactionwithwallet for " "that.\n" "Note that all existing inputs must have their previous output " "transaction be in the wallet.\n" @@ -3652,8 +3642,6 @@ "false) Also select inputs which are watch only\n" " \"lockUnspents\" (boolean, optional, default " "false) Lock selected unspent outputs\n" - " \"reserveChangeKey\" (boolean, optional) " - "DEPRECATED. Reserves the change output key from the keypool\n" " \"feeRate\" (numeric, optional, default not " "set: makes wallet determine the fee) Set a specific fee rate in " + CURRENCY_UNIT + @@ -3690,7 +3678,8 @@ "\nAdd sufficient unsigned inputs to meet the output value\n" + HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + "\nSign the transaction\n" + - HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + + HelpExampleCli("signrawtransactionwithwallet", + "\"fundedtransactionhex\"") + "\nSend the transaction\n" + HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); } @@ -3704,8 +3693,6 @@ CCoinControl coinControl; int changePosition = -1; bool lockUnspents = false; - // DEPRECATED, should be removed in 0.20 - bool reserveChangeKey = false; UniValue subtractFeeFromOutputs; std::set setSubtractFeeFromOutputs; @@ -3725,8 +3712,6 @@ {"changePosition", UniValueType(UniValue::VNUM)}, {"includeWatching", UniValueType(UniValue::VBOOL)}, {"lockUnspents", UniValueType(UniValue::VBOOL)}, - // DEPRECATED, should be removed in 0.20 - {"reserveChangeKey", UniValueType(UniValue::VBOOL)}, // will be checked below {"feeRate", UniValueType()}, {"subtractFeeFromOutputs", UniValueType(UniValue::VARR)}, @@ -3760,22 +3745,6 @@ lockUnspents = options["lockUnspents"].get_bool(); } - // DEPRECATED, should be removed in v0.20 - if (options.exists("reserveChangeKey")) { - if (!IsDeprecatedRPCEnabled(gArgs, "fundrawtransaction")) { - throw JSONRPCError( - RPC_METHOD_DEPRECATED, - "fundrawtransaction -reserveChangeKey is deprecated " - "and will be fully removed in v0.20. To use the " - "-reserveChangeKey option in v0.19, restart bitcoind " - "with -deprecatedrpc=fundrawtransaction.\nProjects " - "should transition to expecting change addresses " - "removed from the keypool before upgrading to v0.20"); - } else { - reserveChangeKey = options["reserveChangeKey"].get_bool(); - } - } - if (options.exists("feeRate")) { coinControl.m_feerate = CFeeRate(AmountFromValue(options["feeRate"])); @@ -3831,7 +3800,7 @@ if (!pwallet->FundTransaction(tx, nFeeOut, changePosition, strFailReason, lockUnspents, setSubtractFeeFromOutputs, - coinControl, reserveChangeKey)) { + coinControl)) { throw JSONRPCError(RPC_WALLET_ERROR, strFailReason); } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1020,7 +1020,7 @@ int &nChangePosInOut, std::string &strFailReason, bool lockUnspents, const std::set &setSubtractFeeFromOutputs, - CCoinControl coinControl, bool keepReserveKey); + CCoinControl coinControl); bool SignTransaction(CMutableTransaction &tx); /** diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -20,7 +20,6 @@ #include #include #include -#include // for IsDeprecatedRPCEnabled #include