aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-10-23 18:11:26 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-10-23 18:15:21 -0400
commit3668bb335c6ae08614057bf0c9f6515687eec007 (patch)
tree51551b2de842e90bcd2f31d52056160cee911866 /src
parentb3f377daaa86cd7755a552fa3adfeb195835f58e (diff)
parentab9aca2bdfe68fcd512955ed2c4d706933088528 (diff)
Merge #14468: [wallet] Deprecate generate RPC method
ab9aca2bdf [rpc] add 'getnewaddress' hint to 'generatetoaddress' help text. (John Newbery) c9f02955b2 [wallet] Deprecate the generate RPC method (John Newbery) aab81720de [tests] Add generate method to TestNode (John Newbery) c269209336 [tests] Small fixups before deprecating generate (John Newbery) Pull request description: Deprecates the `generate` RPC method. For concept discussion, see #14299. Fixes #14299. Tree-SHA512: 16a3b8b742932e4f0476c06b23de07a34d9d215b41d9272c1c9d1e39966b0c2406f17c5ab3cc568947620c08171ebe5eb74fd7ed4b62151363e305ee2937cc80
Diffstat (limited to 'src')
-rw-r--r--src/rpc/mining.cpp2
-rw-r--r--src/wallet/rpcwallet.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index c565b9b4f9..25cfc69da9 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -167,6 +167,8 @@ static UniValue generatetoaddress(const JSONRPCRequest& request)
"\nExamples:\n"
"\nGenerate 11 blocks to myaddress\n"
+ HelpExampleCli("generatetoaddress", "11 \"myaddress\"")
+ + "If you are running the bitcoin core wallet, you can get a new address to send the newly generated bitcoin to with:\n"
+ + HelpExampleCli("getnewaddress", "")
);
int nGenerate = request.params[0].get_int();
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index a3f5f8b211..ea5177b086 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3321,6 +3321,12 @@ UniValue generate(const JSONRPCRequest& request)
);
}
+ if (!IsDeprecatedRPCEnabled("generate")) {
+ throw JSONRPCError(RPC_METHOD_DEPRECATED, "The wallet generate rpc method is deprecated and will be fully removed in v0.19. "
+ "To use generate in v0.18, restart bitcoind with -deprecatedrpc=generate.\n"
+ "Clients should transition to using the node rpc method generatetoaddress\n");
+ }
+
int num_generate = request.params[0].get_int();
uint64_t max_tries = 1000000;
if (!request.params[1].isNull()) {