Merge dabab06a1a into merged_master (Bitcoin PR #19455)

This commit is contained in:
Andrew Poelstra 2020-11-27 19:01:46 +00:00
commit a67921c2c8
3 changed files with 52 additions and 2 deletions

View file

@ -256,6 +256,17 @@ static UniValue generatetodescriptor(const JSONRPCRequest& request)
return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
}
static UniValue generate(const JSONRPCRequest& request)
{
const std::string help_str{"generate ( nblocks maxtries ) has been replaced by the -generate cli option. Refer to -help for more information."};
if (request.fHelp) {
throw std::runtime_error(help_str);
} else {
throw JSONRPCError(RPC_METHOD_NOT_FOUND, help_str);
}
}
static UniValue generatetoaddress(const JSONRPCRequest& request)
{
RPCHelpMan{"generatetoaddress",
@ -1710,6 +1721,7 @@ static const CRPCCommand commands[] =
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
{ "hidden", "generate", &generate, {} },
};
// clang-format on
for (const auto& c : commands) {