mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 09:15:04 +02:00
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
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user