diff --git a/doc/release-notes.md b/doc/release-notes.md --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -3,3 +3,6 @@ This release includes the following features and fixes: + - `signrawtransaction` RPC is now deprecated. The new RPCs + `signrawtransactionwithkey` and `signrawtransactionwithwallet` should + be used instead. diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1084,7 +1084,8 @@ "[{\"txid\":\"id\",\"vout\":n,\"scriptPubKey\":\"hex\"," "\"redeemScript\":\"hex\"},...] [\"privatekey1\",...] sighashtype " ")\n" - "\nSign inputs for raw transaction (serialized, hex-encoded).\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 " @@ -1163,6 +1164,17 @@ 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); diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py --- a/test/functional/rpc_signrawtransaction.py +++ b/test/functional/rpc_signrawtransaction.py @@ -12,6 +12,7 @@ def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 1 + self.extra_args = [["-deprecatedrpc=signrawtransaction"]] def successful_signing_test(self): """Creates and signs a valid raw transaction with one input.