Skip to content

Commit

Permalink
[Daemon] Add alpha reloadmnlist command and fix port in example conf
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaynexus committed Jun 13, 2019
1 parent 7add86f commit a169a14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/masternodeconfig.cpp
Expand Up @@ -27,7 +27,7 @@ bool CMasternodeConfig::read(std::string& strErrRet) {
if (configFile != NULL) {
std::string strHeader = "# Masternode config file\n"
"# Format: alias IP:port masternodeprivkey collateral_output_txid collateral_output_index\n"
"# Example: mn1 127.0.0.2:19797 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0\n";
"# Example: mn1 127.0.0.2:9801 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0\n";
fwrite(strHeader.c_str(), std::strlen(strHeader.c_str()), 1, configFile);
fclose(configFile);
}
Expand Down
17 changes: 17 additions & 0 deletions src/rpc/governance.cpp
Expand Up @@ -994,11 +994,28 @@ UniValue getsuperblockbudget(const JSONRPCRequest& request)
return strBudget;
}

UniValue reloadmnlist(const JSONRPCRequest& request)
{
if (request.fHelp) {
throw std::runtime_error(
"reloadmnlist\n"
"Hot Reloads MN LIST"
);
}
std::string strErr;
if(!masternodeConfig.read(strErr)) {
throw JSONRPCError(RPC_INTERNAL_ERROR, "Error reading masternode configuration file: " + strErr);
}
else{
return "success";
}
}
static const CRPCCommand commands[] =
{ // category name actor (function) okSafe argNames
// --------------------- ------------------------ ----------------------- ------ ----------
/* QuantisNet features */
{ "quantisnet", "getgovernanceinfo", &getgovernanceinfo, true, {} },
{ "quantisnet", "reloadmnlist", &reloadmnlist, true, {} },
{ "quantisnet", "getsuperblockbudget", &getsuperblockbudget, true, {"index"} },
{ "quantisnet", "gobject", &gobject, true, {} },
{ "quantisnet", "voteraw", &voteraw, true, {} },
Expand Down

0 comments on commit a169a14

Please sign in to comment.