mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-14 08:39:35 +02:00
rpc: Remove duplicate name and argNames from CRPCCommand
This commit is contained in:
@@ -2480,41 +2480,41 @@ void RegisterBlockchainRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "blockchain", "getblockchaininfo", &getblockchaininfo, {} },
|
||||
{ "blockchain", "getchaintxstats", &getchaintxstats, {"nblocks", "blockhash"} },
|
||||
{ "blockchain", "getblockstats", &getblockstats, {"hash_or_height", "stats"} },
|
||||
{ "blockchain", "getbestblockhash", &getbestblockhash, {} },
|
||||
{ "blockchain", "getblockcount", &getblockcount, {} },
|
||||
{ "blockchain", "getblock", &getblock, {"blockhash","verbosity|verbose"} },
|
||||
{ "blockchain", "getblockhash", &getblockhash, {"height"} },
|
||||
{ "blockchain", "getblockheader", &getblockheader, {"blockhash","verbose"} },
|
||||
{ "blockchain", "getchaintips", &getchaintips, {} },
|
||||
{ "blockchain", "getdifficulty", &getdifficulty, {} },
|
||||
{ "blockchain", "getmempoolancestors", &getmempoolancestors, {"txid","verbose"} },
|
||||
{ "blockchain", "getmempooldescendants", &getmempooldescendants, {"txid","verbose"} },
|
||||
{ "blockchain", "getmempoolentry", &getmempoolentry, {"txid"} },
|
||||
{ "blockchain", "getmempoolinfo", &getmempoolinfo, {} },
|
||||
{ "blockchain", "getrawmempool", &getrawmempool, {"verbose", "mempool_sequence"} },
|
||||
{ "blockchain", "gettxout", &gettxout, {"txid","n","include_mempool"} },
|
||||
{ "blockchain", "gettxoutsetinfo", &gettxoutsetinfo, {"hash_type"} },
|
||||
{ "blockchain", "pruneblockchain", &pruneblockchain, {"height"} },
|
||||
{ "blockchain", "savemempool", &savemempool, {} },
|
||||
{ "blockchain", "verifychain", &verifychain, {"checklevel","nblocks"} },
|
||||
{ // category actor (function)
|
||||
// --------------------- ------------------------
|
||||
{ "blockchain", &getblockchaininfo, },
|
||||
{ "blockchain", &getchaintxstats, },
|
||||
{ "blockchain", &getblockstats, },
|
||||
{ "blockchain", &getbestblockhash, },
|
||||
{ "blockchain", &getblockcount, },
|
||||
{ "blockchain", &getblock, },
|
||||
{ "blockchain", &getblockhash, },
|
||||
{ "blockchain", &getblockheader, },
|
||||
{ "blockchain", &getchaintips, },
|
||||
{ "blockchain", &getdifficulty, },
|
||||
{ "blockchain", &getmempoolancestors, },
|
||||
{ "blockchain", &getmempooldescendants, },
|
||||
{ "blockchain", &getmempoolentry, },
|
||||
{ "blockchain", &getmempoolinfo, },
|
||||
{ "blockchain", &getrawmempool, },
|
||||
{ "blockchain", &gettxout, },
|
||||
{ "blockchain", &gettxoutsetinfo, },
|
||||
{ "blockchain", &pruneblockchain, },
|
||||
{ "blockchain", &savemempool, },
|
||||
{ "blockchain", &verifychain, },
|
||||
|
||||
{ "blockchain", "preciousblock", &preciousblock, {"blockhash"} },
|
||||
{ "blockchain", "scantxoutset", &scantxoutset, {"action", "scanobjects"} },
|
||||
{ "blockchain", "getblockfilter", &getblockfilter, {"blockhash", "filtertype"} },
|
||||
{ "blockchain", &preciousblock, },
|
||||
{ "blockchain", &scantxoutset, },
|
||||
{ "blockchain", &getblockfilter, },
|
||||
|
||||
/* Not shown in help */
|
||||
{ "hidden", "invalidateblock", &invalidateblock, {"blockhash"} },
|
||||
{ "hidden", "reconsiderblock", &reconsiderblock, {"blockhash"} },
|
||||
{ "hidden", "waitfornewblock", &waitfornewblock, {"timeout"} },
|
||||
{ "hidden", "waitforblock", &waitforblock, {"blockhash","timeout"} },
|
||||
{ "hidden", "waitforblockheight", &waitforblockheight, {"height","timeout"} },
|
||||
{ "hidden", "syncwithvalidationinterfacequeue", &syncwithvalidationinterfacequeue, {} },
|
||||
{ "hidden", "dumptxoutset", &dumptxoutset, {"path"} },
|
||||
{ "hidden", &invalidateblock, },
|
||||
{ "hidden", &reconsiderblock, },
|
||||
{ "hidden", &waitfornewblock, },
|
||||
{ "hidden", &waitforblock, },
|
||||
{ "hidden", &waitforblockheight, },
|
||||
{ "hidden", &syncwithvalidationinterfacequeue, },
|
||||
{ "hidden", &dumptxoutset, },
|
||||
};
|
||||
// clang-format on
|
||||
for (const auto& c : commands) {
|
||||
|
||||
@@ -1232,24 +1232,24 @@ void RegisterMiningRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "mining", "getnetworkhashps", &getnetworkhashps, {"nblocks","height"} },
|
||||
{ "mining", "getmininginfo", &getmininginfo, {} },
|
||||
{ "mining", "prioritisetransaction", &prioritisetransaction, {"txid","dummy","fee_delta"} },
|
||||
{ "mining", "getblocktemplate", &getblocktemplate, {"template_request"} },
|
||||
{ "mining", "submitblock", &submitblock, {"hexdata","dummy"} },
|
||||
{ "mining", "submitheader", &submitheader, {"hexdata"} },
|
||||
{ // category actor (function)
|
||||
// --------------------- -----------------------
|
||||
{ "mining", &getnetworkhashps, },
|
||||
{ "mining", &getmininginfo, },
|
||||
{ "mining", &prioritisetransaction, },
|
||||
{ "mining", &getblocktemplate, },
|
||||
{ "mining", &submitblock, },
|
||||
{ "mining", &submitheader, },
|
||||
|
||||
|
||||
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
|
||||
{ "generating", "generatetodescriptor", &generatetodescriptor, {"num_blocks","descriptor","maxtries"} },
|
||||
{ "generating", "generateblock", &generateblock, {"output","transactions"} },
|
||||
{ "generating", &generatetoaddress, },
|
||||
{ "generating", &generatetodescriptor, },
|
||||
{ "generating", &generateblock, },
|
||||
|
||||
{ "util", "estimatesmartfee", &estimatesmartfee, {"conf_target", "estimate_mode"} },
|
||||
{ "util", &estimatesmartfee, },
|
||||
|
||||
{ "hidden", "estimaterawfee", &estimaterawfee, {"conf_target", "threshold"} },
|
||||
{ "hidden", "generate", &generate, {} },
|
||||
{ "hidden", &estimaterawfee, },
|
||||
{ "hidden", &generate, },
|
||||
};
|
||||
// clang-format on
|
||||
for (const auto& c : commands) {
|
||||
|
||||
@@ -699,23 +699,23 @@ void RegisterMiscRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "control", "getmemoryinfo", &getmemoryinfo, {"mode"} },
|
||||
{ "control", "logging", &logging, {"include", "exclude"}},
|
||||
{ "util", "validateaddress", &validateaddress, {"address"} },
|
||||
{ "util", "createmultisig", &createmultisig, {"nrequired","keys","address_type"} },
|
||||
{ "util", "deriveaddresses", &deriveaddresses, {"descriptor", "range"} },
|
||||
{ "util", "getdescriptorinfo", &getdescriptorinfo, {"descriptor"} },
|
||||
{ "util", "verifymessage", &verifymessage, {"address","signature","message"} },
|
||||
{ "util", "signmessagewithprivkey", &signmessagewithprivkey, {"privkey","message"} },
|
||||
{ "util", "getindexinfo", &getindexinfo, {"index_name"} },
|
||||
{ // category actor (function)
|
||||
// --------------------- ------------------------
|
||||
{ "control", &getmemoryinfo, },
|
||||
{ "control", &logging, },
|
||||
{ "util", &validateaddress, },
|
||||
{ "util", &createmultisig, },
|
||||
{ "util", &deriveaddresses, },
|
||||
{ "util", &getdescriptorinfo, },
|
||||
{ "util", &verifymessage, },
|
||||
{ "util", &signmessagewithprivkey, },
|
||||
{ "util", &getindexinfo, },
|
||||
|
||||
/* Not shown in help */
|
||||
{ "hidden", "setmocktime", &setmocktime, {"timestamp"}},
|
||||
{ "hidden", "mockscheduler", &mockscheduler, {"delta_time"}},
|
||||
{ "hidden", "echo", &echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
|
||||
{ "hidden", "echojson", &echojson, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}},
|
||||
{ "hidden", &setmocktime, },
|
||||
{ "hidden", &mockscheduler, },
|
||||
{ "hidden", &echo, },
|
||||
{ "hidden", &echojson, },
|
||||
};
|
||||
// clang-format on
|
||||
for (const auto& c : commands) {
|
||||
|
||||
@@ -941,24 +941,24 @@ void RegisterNetRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "network", "getconnectioncount", &getconnectioncount, {} },
|
||||
{ "network", "ping", &ping, {} },
|
||||
{ "network", "getpeerinfo", &getpeerinfo, {} },
|
||||
{ "network", "addnode", &addnode, {"node","command"} },
|
||||
{ "network", "disconnectnode", &disconnectnode, {"address", "nodeid"} },
|
||||
{ "network", "getaddednodeinfo", &getaddednodeinfo, {"node"} },
|
||||
{ "network", "getnettotals", &getnettotals, {} },
|
||||
{ "network", "getnetworkinfo", &getnetworkinfo, {} },
|
||||
{ "network", "setban", &setban, {"subnet", "command", "bantime", "absolute"} },
|
||||
{ "network", "listbanned", &listbanned, {} },
|
||||
{ "network", "clearbanned", &clearbanned, {} },
|
||||
{ "network", "setnetworkactive", &setnetworkactive, {"state"} },
|
||||
{ "network", "getnodeaddresses", &getnodeaddresses, {"count"} },
|
||||
{ // category actor
|
||||
// --------------------- -----------------------
|
||||
{ "network", &getconnectioncount, },
|
||||
{ "network", &ping, },
|
||||
{ "network", &getpeerinfo, },
|
||||
{ "network", &addnode, },
|
||||
{ "network", &disconnectnode, },
|
||||
{ "network", &getaddednodeinfo, },
|
||||
{ "network", &getnettotals, },
|
||||
{ "network", &getnetworkinfo, },
|
||||
{ "network", &setban, },
|
||||
{ "network", &listbanned, },
|
||||
{ "network", &clearbanned, },
|
||||
{ "network", &setnetworkactive, },
|
||||
{ "network", &getnodeaddresses, },
|
||||
|
||||
{ "hidden", "addconnection", &addconnection, {"address", "connection_type"} },
|
||||
{ "hidden", "addpeeraddress", &addpeeraddress, {"address", "port"} },
|
||||
{ "hidden", &addconnection, },
|
||||
{ "hidden", &addpeeraddress, },
|
||||
};
|
||||
// clang-format on
|
||||
for (const auto& c : commands) {
|
||||
|
||||
@@ -1859,27 +1859,27 @@ void RegisterRawTransactionRPCCommands(CRPCTable &t)
|
||||
{
|
||||
// clang-format off
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ "rawtransactions", "getrawtransaction", &getrawtransaction, {"txid","verbose","blockhash"} },
|
||||
{ "rawtransactions", "createrawtransaction", &createrawtransaction, {"inputs","outputs","locktime","replaceable"} },
|
||||
{ "rawtransactions", "decoderawtransaction", &decoderawtransaction, {"hexstring","iswitness"} },
|
||||
{ "rawtransactions", "decodescript", &decodescript, {"hexstring"} },
|
||||
{ "rawtransactions", "sendrawtransaction", &sendrawtransaction, {"hexstring","maxfeerate"} },
|
||||
{ "rawtransactions", "combinerawtransaction", &combinerawtransaction, {"txs"} },
|
||||
{ "rawtransactions", "signrawtransactionwithkey", &signrawtransactionwithkey, {"hexstring","privkeys","prevtxs","sighashtype"} },
|
||||
{ "rawtransactions", "testmempoolaccept", &testmempoolaccept, {"rawtxs","maxfeerate"} },
|
||||
{ "rawtransactions", "decodepsbt", &decodepsbt, {"psbt"} },
|
||||
{ "rawtransactions", "combinepsbt", &combinepsbt, {"txs"} },
|
||||
{ "rawtransactions", "finalizepsbt", &finalizepsbt, {"psbt", "extract"} },
|
||||
{ "rawtransactions", "createpsbt", &createpsbt, {"inputs","outputs","locktime","replaceable"} },
|
||||
{ "rawtransactions", "converttopsbt", &converttopsbt, {"hexstring","permitsigdata","iswitness"} },
|
||||
{ "rawtransactions", "utxoupdatepsbt", &utxoupdatepsbt, {"psbt", "descriptors"} },
|
||||
{ "rawtransactions", "joinpsbts", &joinpsbts, {"txs"} },
|
||||
{ "rawtransactions", "analyzepsbt", &analyzepsbt, {"psbt"} },
|
||||
{ // category actor (function)
|
||||
// --------------------- -----------------------
|
||||
{ "rawtransactions", &getrawtransaction, },
|
||||
{ "rawtransactions", &createrawtransaction, },
|
||||
{ "rawtransactions", &decoderawtransaction, },
|
||||
{ "rawtransactions", &decodescript, },
|
||||
{ "rawtransactions", &sendrawtransaction, },
|
||||
{ "rawtransactions", &combinerawtransaction, },
|
||||
{ "rawtransactions", &signrawtransactionwithkey, },
|
||||
{ "rawtransactions", &testmempoolaccept, },
|
||||
{ "rawtransactions", &decodepsbt, },
|
||||
{ "rawtransactions", &combinepsbt, },
|
||||
{ "rawtransactions", &finalizepsbt, },
|
||||
{ "rawtransactions", &createpsbt, },
|
||||
{ "rawtransactions", &converttopsbt, },
|
||||
{ "rawtransactions", &utxoupdatepsbt, },
|
||||
{ "rawtransactions", &joinpsbts, },
|
||||
{ "rawtransactions", &analyzepsbt, },
|
||||
|
||||
{ "blockchain", "gettxoutproof", &gettxoutproof, {"txids", "blockhash"} },
|
||||
{ "blockchain", "verifytxoutproof", &verifytxoutproof, {"proof"} },
|
||||
{ "blockchain", &gettxoutproof, },
|
||||
{ "blockchain", &verifytxoutproof, },
|
||||
};
|
||||
// clang-format on
|
||||
for (const auto& c : commands) {
|
||||
|
||||
@@ -249,13 +249,13 @@ static RPCHelpMan getrpcinfo()
|
||||
|
||||
// clang-format off
|
||||
static const CRPCCommand vRPCCommands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
{ // category actor (function)
|
||||
// --------------------- -----------------------
|
||||
/* Overall control/query calls */
|
||||
{ "control", "getrpcinfo", &getrpcinfo, {} },
|
||||
{ "control", "help", &help, {"command"} },
|
||||
{ "control", "stop", &stop, {"wait"} },
|
||||
{ "control", "uptime", &uptime, {} },
|
||||
{ "control", &getrpcinfo, },
|
||||
{ "control", &help, },
|
||||
{ "control", &stop, },
|
||||
{ "control", &uptime, },
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
}
|
||||
|
||||
//! Simplified constructor taking plain RpcMethodFnType function pointer.
|
||||
CRPCCommand(std::string category, std::string name_in, RpcMethodFnType fn, std::vector<std::string> args_in)
|
||||
CRPCCommand(std::string category, RpcMethodFnType fn)
|
||||
: CRPCCommand(
|
||||
category,
|
||||
fn().m_name,
|
||||
@@ -111,8 +111,6 @@ public:
|
||||
fn().GetArgNames(),
|
||||
intptr_t(fn))
|
||||
{
|
||||
CHECK_NONFATAL(fn().m_name == name_in);
|
||||
CHECK_NONFATAL(fn().GetArgNames() == args_in);
|
||||
}
|
||||
|
||||
std::string category;
|
||||
|
||||
Reference in New Issue
Block a user