Skip to content

Commit

Permalink
Change getmininginfo to getstakinginfo
Browse files Browse the repository at this point in the history
Retain getmininginfo as an alias for backwards compatibility.
  • Loading branch information
jamescowens committed Nov 25, 2021
1 parent 248fc25 commit a070b18
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ bool IsMiningAllowed(CWallet *pwallet)
}

// This function parses the config file for the directives for side staking. It is used
// in StakeMiner for the miner loop and also called by rpc getmininginfo.
// in StakeMiner for the miner loop and also called by rpc getstakinginfo.
SideStakeAlloc GetSideStakingStatusAndAlloc()
{
SideStakeAlloc vSideStakeAlloc;
Expand Down Expand Up @@ -1138,7 +1138,7 @@ SideStakeAlloc GetSideStakingStatusAndAlloc()
}

// This function parses the config file for the directives for stake splitting. It is used
// in StakeMiner for the miner loop and also called by rpc getmininginfo.
// in StakeMiner for the miner loop and also called by rpc getstakinginfo.
bool GetStakeSplitStatusAndParams(int64_t& nMinStakeSplitValue, double& dEfficiency, int64_t& nDesiredStakeOutputValue)
{
// Parse StakeSplit and SideStaking flags.
Expand Down
2 changes: 1 addition & 1 deletion src/qt/researcher/researchermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ QString ResearcherModel::formatStatus() const
return tr("Waiting for sync...");
}

// TODO: The getmininginfo RPC shares this global. Refactor to remove it:
// TODO: The getstakinginfo RPC shares this global. Refactor to remove it:
return QString::fromStdString(msMiningErrors);
}

Expand Down
4 changes: 2 additions & 2 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

using namespace std;

UniValue getmininginfo(const UniValue& params, bool fHelp)
UniValue getstakinginfo(const UniValue& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getmininginfo\n"
"getstakinginfo\n"
"\n"
"Returns an object containing mining-related information\n");

Expand Down
35 changes: 18 additions & 17 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ UniValue help(const UniValue& params, bool fHelp)
"\n"
"Categories:\n"
"wallet --------> Returns help for blockchain related commands\n"
"mining --------> Returns help for staking/cpid/beacon related commands\n"
"staking -------> Returns help for staking/cpid/beacon related commands\n"
"developer -----> Returns help for developer commands\n"
"network -------> Returns help for network related commands\n"
"voting --------> Returns help for voting related commands\n"
Expand All @@ -236,8 +236,8 @@ UniValue help(const UniValue& params, bool fHelp)
if (strCommand == "wallet")
category = cat_wallet;

else if (strCommand == "mining")
category = cat_mining;
else if (strCommand == "staking" || strCommand == "mining")
category = cat_staking;

else if (strCommand == "developer")
category = cat_developer;
Expand Down Expand Up @@ -348,20 +348,21 @@ static const CRPCCommand vRPCCommands[] =
{ "walletpassphrasechange", &walletpassphrasechange, cat_wallet },

// Mining commands
{ "advertisebeacon", &advertisebeacon, cat_mining },
{ "beaconconvergence", &beaconconvergence, cat_mining },
{ "beaconreport", &beaconreport, cat_mining },
{ "beaconstatus", &beaconstatus, cat_mining },
{ "explainmagnitude", &explainmagnitude, cat_mining },
{ "getlaststake", &getlaststake, cat_mining },
{ "getmininginfo", &getmininginfo, cat_mining },
{ "lifetime", &lifetime, cat_mining },
{ "magnitude", &magnitude, cat_mining },
{ "pendingbeaconreport", &pendingbeaconreport, cat_mining },
{ "resetcpids", &resetcpids, cat_mining },
{ "revokebeacon", &revokebeacon, cat_mining },
{ "superblockage", &superblockage, cat_mining },
{ "superblocks", &superblocks, cat_mining },
{ "advertisebeacon", &advertisebeacon, cat_staking },
{ "beaconconvergence", &beaconconvergence, cat_staking },
{ "beaconreport", &beaconreport, cat_staking },
{ "beaconstatus", &beaconstatus, cat_staking },
{ "explainmagnitude", &explainmagnitude, cat_staking },
{ "getlaststake", &getlaststake, cat_staking },
{ "getstakinginfo", &getstakinginfo, cat_staking },
{ "getmininginfo", &getstakinginfo, cat_staking }, //alias for getstakinginfo (compatibility)
{ "lifetime", &lifetime, cat_staking },
{ "magnitude", &magnitude, cat_staking },
{ "pendingbeaconreport", &pendingbeaconreport, cat_staking },
{ "resetcpids", &resetcpids, cat_staking },
{ "revokebeacon", &revokebeacon, cat_staking },
{ "superblockage", &superblockage, cat_staking },
{ "superblocks", &superblocks, cat_staking },

// Developer commands
{ "auditsnapshotaccrual", &auditsnapshotaccrual, cat_developer },
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum rpccategory
{
cat_null,
cat_wallet,
cat_mining,
cat_staking,
cat_developer,
cat_network,
cat_voting,
Expand Down Expand Up @@ -170,7 +170,7 @@ extern UniValue beaconconvergence(const UniValue& params, bool fHelp);
extern UniValue beaconstatus(const UniValue& params, bool fHelp);
extern UniValue explainmagnitude(const UniValue& params, bool fHelp);
extern UniValue getlaststake(const UniValue& params, bool fHelp);
extern UniValue getmininginfo(const UniValue& params, bool fHelp);
extern UniValue getstakinginfo(const UniValue& params, bool fHelp);
extern UniValue lifetime(const UniValue& params, bool fHelp);
extern UniValue magnitude(const UniValue& params, bool fHelp);
extern UniValue pendingbeaconreport(const UniValue& params, bool fHelp);
Expand Down

0 comments on commit a070b18

Please sign in to comment.