diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-01-18 11:00:16 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-01-18 11:03:53 +0100 |
| commit | 17180fa608100ce1aab3df74c9db17c342c0380d (patch) | |
| tree | d13952acf9acc384ebf0b89c0beb6e610d4a5556 /src | |
| parent | Merge #12101: Clamp walletpassphrase timeout to 2^30 seconds and check its bo... (diff) | |
| parent | wallet: Deprecate addwitnessaddress (diff) | |
| download | discoin-17180fa608100ce1aab3df74c9db17c342c0380d.tar.xz discoin-17180fa608100ce1aab3df74c9db17c342c0380d.zip | |
Merge #12210: wallet: Deprecate addwitnessaddress
cdf3e03 wallet: Deprecate addwitnessaddress (Wladimir J. van der Laan)
Pull request description:
Now that segwit is natively supported by the wallet, deprecate the hack `addwitnessaddress`.
Tree-SHA512: f33b1c33d200fa8f1a0fba424b30e9c2a78147cde8bb0a3fd41194b77980454cddfb23da256cd6fe78726e87161deaa23357d0764e74c3eb83177cc518afa49c
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/rpcwallet.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 53e953074..ad0ebcce2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1285,7 +1285,8 @@ UniValue addwitnessaddress(const JSONRPCRequest& request) if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) { std::string msg = "addwitnessaddress \"address\" ( p2sh )\n" - "\nAdd a witness address for a script (with pubkey or redeemscript known). Requires a new wallet backup.\n" + "\nDEPRECATED: set the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead.\n" + "Add a witness address for a script (with pubkey or redeemscript known). Requires a new wallet backup.\n" "It returns the witness script.\n" "\nArguments:\n" @@ -1299,6 +1300,12 @@ UniValue addwitnessaddress(const JSONRPCRequest& request) throw std::runtime_error(msg); } + if (!IsDeprecatedRPCEnabled("addwitnessaddress")) { + throw JSONRPCError(RPC_METHOD_DEPRECATED, "addwitnessaddress is deprecated and will be fully removed in v0.17. " + "To use addwitnessaddress in v0.16, restart bitcoind with -deprecatedrpc=addwitnessaddress.\n" + "Projects should transition to using the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead.\n"); + } + { LOCK(cs_main); if (!IsWitnessEnabled(chainActive.Tip(), Params().GetConsensus()) && !gArgs.GetBoolArg("-walletprematurewitness", false)) { @@ -3479,7 +3486,7 @@ static const CRPCCommand commands[] = { "wallet", "abandontransaction", &abandontransaction, {"txid"} }, { "wallet", "abortrescan", &abortrescan, {} }, { "wallet", "addmultisigaddress", &addmultisigaddress, {"nrequired","keys","account"} }, - { "wallet", "addwitnessaddress", &addwitnessaddress, {"address","p2sh"} }, + { "hidden", "addwitnessaddress", &addwitnessaddress, {"address","p2sh"} }, { "wallet", "backupwallet", &backupwallet, {"destination"} }, { "wallet", "bumpfee", &bumpfee, {"txid", "options"} }, { "wallet", "dumpprivkey", &dumpprivkey, {"address"} }, |