From 59ddac5656a44b1a5c4c317ac9317b0d47a01951 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 11 Dec 2024 17:02:16 +0700 Subject: [PATCH] feat: hide deprecated RPC from help and add TODOes to remove them --- src/rpc/coinjoin.cpp | 4 +++- src/rpc/masternode.cpp | 8 +++++--- src/rpc/net.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/rpc/coinjoin.cpp b/src/rpc/coinjoin.cpp index 8e477ce8ce..81f6c37933 100644 --- a/src/rpc/coinjoin.cpp +++ b/src/rpc/coinjoin.cpp @@ -365,6 +365,7 @@ static RPCHelpMan coinjoinsalt_set() } #endif // ENABLE_WALLET +// TODO: remove it completely static RPCHelpMan getpoolinfo() { return RPCHelpMan{"getpoolinfo", @@ -469,7 +470,6 @@ void RegisterCoinJoinRPCCommands(CRPCTable &t) static const CRPCCommand commands[] = { // category actor (function) // --------------------- ----------------------- - { "dash", &getpoolinfo, }, { "dash", &getcoinjoininfo, }, #ifdef ENABLE_WALLET { "dash", &coinjoin, }, @@ -480,6 +480,8 @@ static const CRPCCommand commands[] = { "dash", &coinjoinsalt_generate, }, { "dash", &coinjoinsalt_get, }, { "dash", &coinjoinsalt_set, }, + + { "hidden", &getpoolinfo, }, #endif // ENABLE_WALLET }; // clang-format on diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index b18f7ef06d..5a1e2cb826 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -133,6 +133,7 @@ static UniValue GetNextMasternodeForPayment(const CChain& active_chain, CDetermi return obj; } +// TODO: drop it static RPCHelpMan masternode_winner() { return RPCHelpMan{"masternode winner", @@ -153,6 +154,7 @@ static RPCHelpMan masternode_winner() }; } +// TODO: drop it static RPCHelpMan masternode_current() { return RPCHelpMan{"masternode current", @@ -226,7 +228,7 @@ static RPCHelpMan masternode_status() } UniValue mnObj(UniValue::VOBJ); - // keep compatibility with legacy status for now (might get deprecated/removed later) + // keep compatibility with legacy status for now (TODO: get deprecated/removed later) mnObj.pushKV("outpoint", node.mn_activeman->GetOutPoint().ToStringShort()); mnObj.pushKV("service", node.mn_activeman->GetService().ToStringAddrPort()); auto dmn = CHECK_NONFATAL(node.dmnman)->GetListAtChainTip().GetMN(node.mn_activeman->GetProTxHash()); @@ -749,8 +751,8 @@ static const CRPCCommand commands[] = { "dash", &masternode_status, }, { "dash", &masternode_payments, }, { "dash", &masternode_winners, }, - { "dash", &masternode_current, }, - { "dash", &masternode_winner, }, + { "hidden", &masternode_current, }, + { "hidden", &masternode_winner, }, }; // clang-format on for (const auto& command : commands) { diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index f61b9147c4..9667a48e98 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -241,7 +241,7 @@ static RPCHelpMan getpeerinfo() obj.pushKV("masternode", stats.m_masternode_connection); if (fStateStats) { if (IsDeprecatedRPCEnabled("banscore")) { - // banscore is deprecated in v21 for removal in v22 + // TODO: banscore is deprecated in v21 for removal in v22, maybe impossible due to usages in p2p_quorum_data.py obj.pushKV("banscore", statestats.m_misbehavior_score); } obj.pushKV("startingheight", statestats.m_starting_height);