mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
rpc: print useful help and error message for generate
This commit is contained in:
parent
8d32d2011d
commit
92d94ffb8d
1 changed files with 12 additions and 0 deletions
|
|
@ -236,6 +236,17 @@ static UniValue generatetodescriptor(const JSONRPCRequest& request)
|
||||||
return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
|
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)
|
static UniValue generatetoaddress(const JSONRPCRequest& request)
|
||||||
{
|
{
|
||||||
RPCHelpMan{"generatetoaddress",
|
RPCHelpMan{"generatetoaddress",
|
||||||
|
|
@ -1198,6 +1209,7 @@ static const CRPCCommand commands[] =
|
||||||
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
|
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
|
||||||
|
|
||||||
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
|
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
|
||||||
|
{ "hidden", "generate", &generate, {} },
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue