Skip to content

Commit b079abf

Browse files
committed
[RPC] Remove deprecated masternode/budget RPC commands
The old `masternode` and `mnbudget` commands have been deprecated for quite some time now, and have had a note in their help descriptions stating as much. So, time to finally remove them for good.
1 parent cfa3092 commit b079abf

File tree

5 files changed

+1
-253
lines changed

5 files changed

+1
-253
lines changed

src/rpc/budget.cpp

-103
Original file line numberDiff line numberDiff line change
@@ -49,109 +49,6 @@ void budgetToJSON(CBudgetProposal* pbudgetProposal, UniValue& bObj)
4949
bObj.push_back(Pair("fValid", pbudgetProposal->fValid));
5050
}
5151

52-
// This command is retained for backwards compatibility, but is depreciated.
53-
// Future removal of this command is planned to keep things clean.
54-
UniValue mnbudget(const UniValue& params, bool fHelp)
55-
{
56-
string strCommand;
57-
if (params.size() >= 1)
58-
strCommand = params[0].get_str();
59-
60-
if (fHelp ||
61-
(strCommand != "vote-alias" && strCommand != "vote-many" && strCommand != "prepare" && strCommand != "submit" && strCommand != "vote" && strCommand != "getvotes" && strCommand != "getinfo" && strCommand != "show" && strCommand != "projection" && strCommand != "check" && strCommand != "nextblock"))
62-
throw runtime_error(
63-
"mnbudget \"command\"... ( \"passphrase\" )\n"
64-
"\nVote or show current budgets\n"
65-
"This command is depreciated, please see individual command documentation for future reference\n\n"
66-
67-
"\nAvailable commands:\n"
68-
" prepare - Prepare proposal for network by signing and creating tx\n"
69-
" submit - Submit proposal for network\n"
70-
" vote-many - Vote on a PIVX initiative\n"
71-
" vote-alias - Vote on a PIVX initiative\n"
72-
" vote - Vote on a PIVX initiative/budget\n"
73-
" getvotes - Show current masternode budgets\n"
74-
" getinfo - Show current masternode budgets\n"
75-
" show - Show all budgets\n"
76-
" projection - Show the projection of which proposals will be paid the next cycle\n"
77-
" check - Scan proposals and remove invalid\n"
78-
" nextblock - Get next superblock for budget system\n");
79-
80-
if (strCommand == "nextblock") {
81-
UniValue newParams(UniValue::VARR);
82-
// forward params but skip command
83-
for (unsigned int i = 1; i < params.size(); i++) {
84-
newParams.push_back(params[i]);
85-
}
86-
return getnextsuperblock(newParams, fHelp);
87-
}
88-
89-
if (strCommand == "prepare") {
90-
UniValue newParams(UniValue::VARR);
91-
// forward params but skip command
92-
for (unsigned int i = 1; i < params.size(); i++) {
93-
newParams.push_back(params[i]);
94-
}
95-
return preparebudget(newParams, fHelp);
96-
}
97-
98-
if (strCommand == "submit") {
99-
UniValue newParams(UniValue::VARR);
100-
// forward params but skip command
101-
for (unsigned int i = 1; i < params.size(); i++) {
102-
newParams.push_back(params[i]);
103-
}
104-
return submitbudget(newParams, fHelp);
105-
}
106-
107-
if (strCommand == "vote" || strCommand == "vote-many" || strCommand == "vote-alias") {
108-
if (strCommand == "vote-alias")
109-
throw runtime_error(
110-
"vote-alias is not supported with this command\n"
111-
"Please use mnbudgetvote instead.\n"
112-
);
113-
return mnbudgetvote(params, fHelp);
114-
}
115-
116-
if (strCommand == "projection") {
117-
UniValue newParams(UniValue::VARR);
118-
// forward params but skip command
119-
for (unsigned int i = 1; i < params.size(); i++) {
120-
newParams.push_back(params[i]);
121-
}
122-
return getbudgetprojection(newParams, fHelp);
123-
}
124-
125-
if (strCommand == "show" || strCommand == "getinfo") {
126-
UniValue newParams(UniValue::VARR);
127-
// forward params but skip command
128-
for (unsigned int i = 1; i < params.size(); i++) {
129-
newParams.push_back(params[i]);
130-
}
131-
return getbudgetinfo(newParams, fHelp);
132-
}
133-
134-
if (strCommand == "getvotes") {
135-
UniValue newParams(UniValue::VARR);
136-
// forward params but skip command
137-
for (unsigned int i = 1; i < params.size(); i++) {
138-
newParams.push_back(params[i]);
139-
}
140-
return getbudgetvotes(newParams, fHelp);
141-
}
142-
143-
if (strCommand == "check") {
144-
UniValue newParams(UniValue::VARR);
145-
// forward params but skip command
146-
for (unsigned int i = 1; i < params.size(); i++) {
147-
newParams.push_back(params[i]);
148-
}
149-
return checkbudgets(newParams, fHelp);
150-
}
151-
152-
return NullUniValue;
153-
}
154-
15552
UniValue preparebudget(const UniValue& params, bool fHelp)
15653
{
15754
int nBlockMin = 0;

src/rpc/client.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
108108
{"setban", 2},
109109
{"setban", 3},
110110
{"spork", 1},
111-
{"mnbudget", 3},
112-
{"mnbudget", 4},
113-
{"mnbudget", 6},
114-
{"mnbudget", 8},
115111
{"preparebudget", 2},
116112
{"preparebudget", 3},
117113
{"preparebudget", 5},

src/rpc/masternode.cpp

-141
Original file line numberDiff line numberDiff line change
@@ -45,147 +45,6 @@ UniValue getpoolinfo(const UniValue& params, bool fHelp)
4545
return obj;
4646
}
4747

48-
// This command is retained for backwards compatibility, but is depreciated.
49-
// Future removal of this command is planned to keep things clean.
50-
UniValue masternode(const UniValue& params, bool fHelp)
51-
{
52-
string strCommand;
53-
if (params.size() >= 1)
54-
strCommand = params[0].get_str();
55-
56-
if (fHelp ||
57-
(strCommand != "start" && strCommand != "start-alias" && strCommand != "start-many" && strCommand != "start-all" && strCommand != "start-missing" &&
58-
strCommand != "start-disabled" && strCommand != "list" && strCommand != "list-conf" && strCommand != "count" && strCommand != "enforce" &&
59-
strCommand != "debug" && strCommand != "current" && strCommand != "winners" && strCommand != "genkey" && strCommand != "connect" &&
60-
strCommand != "outputs" && strCommand != "status" && strCommand != "calcscore"))
61-
throw runtime_error(
62-
"masternode \"command\"...\n"
63-
"\nSet of commands to execute masternode related actions\n"
64-
"This command is depreciated, please see individual command documentation for future reference\n\n"
65-
66-
"\nArguments:\n"
67-
"1. \"command\" (string or set of strings, required) The command to execute\n"
68-
69-
"\nAvailable commands:\n"
70-
" count - Print count information of all known masternodes\n"
71-
" current - Print info on current masternode winner\n"
72-
" debug - Print masternode status\n"
73-
" genkey - Generate new masternodeprivkey\n"
74-
" outputs - Print masternode compatible outputs\n"
75-
" start - Start masternode configured in pivx.conf\n"
76-
" start-alias - Start single masternode by assigned alias configured in masternode.conf\n"
77-
" start-<mode> - Start masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')\n"
78-
" status - Print masternode status information\n"
79-
" list - Print list of all known masternodes (see masternodelist for more info)\n"
80-
" list-conf - Print masternode.conf in JSON format\n"
81-
" winners - Print list of masternode winners\n");
82-
83-
if (strCommand == "list") {
84-
UniValue newParams(UniValue::VARR);
85-
// forward params but skip command
86-
for (unsigned int i = 1; i < params.size(); i++) {
87-
newParams.push_back(params[i]);
88-
}
89-
return listmasternodes(newParams, fHelp);
90-
}
91-
92-
if (strCommand == "connect") {
93-
UniValue newParams(UniValue::VARR);
94-
// forward params but skip command
95-
for (unsigned int i = 1; i < params.size(); i++) {
96-
newParams.push_back(params[i]);
97-
}
98-
return masternodeconnect(newParams, fHelp);
99-
}
100-
101-
if (strCommand == "count") {
102-
UniValue newParams(UniValue::VARR);
103-
// forward params but skip command
104-
for (unsigned int i = 1; i < params.size(); i++) {
105-
newParams.push_back(params[i]);
106-
}
107-
return getmasternodecount(newParams, fHelp);
108-
}
109-
110-
if (strCommand == "current") {
111-
UniValue newParams(UniValue::VARR);
112-
// forward params but skip command
113-
for (unsigned int i = 1; i < params.size(); i++) {
114-
newParams.push_back(params[i]);
115-
}
116-
return masternodecurrent(newParams, fHelp);
117-
}
118-
119-
if (strCommand == "debug") {
120-
UniValue newParams(UniValue::VARR);
121-
// forward params but skip command
122-
for (unsigned int i = 1; i < params.size(); i++) {
123-
newParams.push_back(params[i]);
124-
}
125-
return masternodedebug(newParams, fHelp);
126-
}
127-
128-
if (strCommand == "start" || strCommand == "start-alias" || strCommand == "start-many" || strCommand == "start-all" || strCommand == "start-missing" || strCommand == "start-disabled") {
129-
return startmasternode(params, fHelp);
130-
}
131-
132-
if (strCommand == "genkey") {
133-
UniValue newParams(UniValue::VARR);
134-
// forward params but skip command
135-
for (unsigned int i = 1; i < params.size(); i++) {
136-
newParams.push_back(params[i]);
137-
}
138-
return createmasternodekey(newParams, fHelp);
139-
}
140-
141-
if (strCommand == "list-conf") {
142-
UniValue newParams(UniValue::VARR);
143-
// forward params but skip command
144-
for (unsigned int i = 1; i < params.size(); i++) {
145-
newParams.push_back(params[i]);
146-
}
147-
return listmasternodeconf(newParams, fHelp);
148-
}
149-
150-
if (strCommand == "outputs") {
151-
UniValue newParams(UniValue::VARR);
152-
// forward params but skip command
153-
for (unsigned int i = 1; i < params.size(); i++) {
154-
newParams.push_back(params[i]);
155-
}
156-
return getmasternodeoutputs(newParams, fHelp);
157-
}
158-
159-
if (strCommand == "status") {
160-
UniValue newParams(UniValue::VARR);
161-
// forward params but skip command
162-
for (unsigned int i = 1; i < params.size(); i++) {
163-
newParams.push_back(params[i]);
164-
}
165-
return getmasternodestatus(newParams, fHelp);
166-
}
167-
168-
if (strCommand == "winners") {
169-
UniValue newParams(UniValue::VARR);
170-
// forward params but skip command
171-
for (unsigned int i = 1; i < params.size(); i++) {
172-
newParams.push_back(params[i]);
173-
}
174-
return getmasternodewinners(newParams, fHelp);
175-
}
176-
177-
if (strCommand == "calcscore") {
178-
UniValue newParams(UniValue::VARR);
179-
// forward params but skip command
180-
for (unsigned int i = 1; i < params.size(); i++) {
181-
newParams.push_back(params[i]);
182-
}
183-
return getmasternodescores(newParams, fHelp);
184-
}
185-
186-
return NullUniValue;
187-
}
188-
18948
UniValue listmasternodes(const UniValue& params, bool fHelp)
19049
{
19150
std::string strFilter = "";

src/rpc/server.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ static const CRPCCommand vRPCCommands[] =
365365
{ "hidden", "waitforblockheight", &waitforblockheight, true, true, false },
366366

367367
/* PIVX features */
368-
{"pivx", "masternode", &masternode, true, true, false},
369368
{"pivx", "listmasternodes", &listmasternodes, true, true, false},
370369
{"pivx", "getmasternodecount", &getmasternodecount, true, true, false},
371370
{"pivx", "masternodeconnect", &masternodeconnect, true, true, false},
@@ -381,7 +380,6 @@ static const CRPCCommand vRPCCommands[] =
381380
{"pivx", "getmasternodestatus", &getmasternodestatus, true, true, false},
382381
{"pivx", "getmasternodewinners", &getmasternodewinners, true, true, false},
383382
{"pivx", "getmasternodescores", &getmasternodescores, true, true, false},
384-
{"pivx", "mnbudget", &mnbudget, true, true, false},
385383
{"pivx", "preparebudget", &preparebudget, true, true, false},
386384
{"pivx", "submitbudget", &submitbudget, true, true, false},
387385
{"pivx", "mnbudgetvote", &mnbudgetvote, true, true, false},

src/rpc/server.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ extern UniValue getserials(const UniValue& params, bool fHelp);
312312
extern UniValue getchecksumblock(const UniValue& params, bool fHelp);
313313

314314
extern UniValue getpoolinfo(const UniValue& params, bool fHelp); // in rpc/masternode.cpp
315-
extern UniValue masternode(const UniValue& params, bool fHelp);
316315
extern UniValue listmasternodes(const UniValue& params, bool fHelp);
317316
extern UniValue getmasternodecount(const UniValue& params, bool fHelp);
318317
extern UniValue createmasternodebroadcast(const UniValue& params, bool fHelp);
@@ -329,8 +328,7 @@ extern UniValue getmasternodestatus(const UniValue& params, bool fHelp);
329328
extern UniValue getmasternodewinners(const UniValue& params, bool fHelp);
330329
extern UniValue getmasternodescores(const UniValue& params, bool fHelp);
331330

332-
extern UniValue mnbudget(const UniValue& params, bool fHelp); // in rpc/budget.cpp
333-
extern UniValue preparebudget(const UniValue& params, bool fHelp);
331+
extern UniValue preparebudget(const UniValue& params, bool fHelp); // in rpc/budget.cpp
334332
extern UniValue submitbudget(const UniValue& params, bool fHelp);
335333
extern UniValue mnbudgetvote(const UniValue& params, bool fHelp);
336334
extern UniValue getbudgetvotes(const UniValue& params, bool fHelp);

0 commit comments

Comments
 (0)