Skip to content

Commit

Permalink
init: move Masternode arguments inside tiertwo/init GetTierTwoHelpString
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Jan 19, 2022
1 parent fda28bd commit 918db4e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_DISABLE_SAFEMODE = false;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
static const bool DEFAULT_MNCONFLOCK = true;

std::unique_ptr<CConnman> g_connman;
std::unique_ptr<PeerLogicValidation> peerLogic;
Expand Down Expand Up @@ -516,14 +515,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-shrinkdebugfile", "Shrink debug.log file on client startup (default: 1 when no -debug)");
AppendParamsHelpMessages(strUsage, showDebug);

strUsage += HelpMessageGroup("Masternode options:");
strUsage += HelpMessageOpt("-masternode=<n>", strprintf("Enable the client to act as a masternode (0-1, default: %u)", DEFAULT_MASTERNODE));
strUsage += HelpMessageOpt("-mnconf=<file>", strprintf("Specify masternode configuration file (default: %s)", PIVX_MASTERNODE_CONF_FILENAME));
strUsage += HelpMessageOpt("-mnconflock=<n>", strprintf("Lock masternodes from masternode configuration file (default: %u)", DEFAULT_MNCONFLOCK));
strUsage += HelpMessageOpt("-masternodeprivkey=<n>", "Set the masternode private key");
strUsage += HelpMessageOpt("-masternodeaddr=<n>", strprintf("Set external address:port to get to this masternode (example: %s)", "128.127.106.235:51472"));
strUsage += HelpMessageOpt("-budgetvotemode=<mode>", "Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)");
strUsage += HelpMessageOpt("-mnoperatorprivatekey=<WIF>", "Set the masternode operator private key. Only valid with -masternode=1. When set, the masternode acts as a deterministic masternode.");
strUsage += GetTierTwoHelpString(showDebug);
if (showDebug) {
strUsage += HelpMessageOpt("-pushversion",
strprintf("Modifies the mnauth serialization if the version is lower than %d."
Expand Down
13 changes: 13 additions & 0 deletions src/tiertwo/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@

#include <boost/thread.hpp>

std::string GetTierTwoHelpString(bool showDebug)
{
std::string strUsage = HelpMessageGroup("Masternode options:");
strUsage += HelpMessageOpt("-masternode=<n>", strprintf("Enable the client to act as a masternode (0-1, default: %u)", DEFAULT_MASTERNODE));
strUsage += HelpMessageOpt("-mnconf=<file>", strprintf("Specify masternode configuration file (default: %s)", PIVX_MASTERNODE_CONF_FILENAME));
strUsage += HelpMessageOpt("-mnconflock=<n>", strprintf("Lock masternodes from masternode configuration file (default: %u)", DEFAULT_MNCONFLOCK));
strUsage += HelpMessageOpt("-masternodeprivkey=<n>", "Set the masternode private key");
strUsage += HelpMessageOpt("-masternodeaddr=<n>", strprintf("Set external address:port to get to this masternode (example: %s)", "128.127.106.235:51472"));
strUsage += HelpMessageOpt("-budgetvotemode=<mode>", "Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)");
strUsage += HelpMessageOpt("-mnoperatorprivatekey=<WIF>", "Set the masternode operator private key. Only valid with -masternode=1. When set, the masternode acts as a deterministic masternode.");
return strUsage;
}

// Sets the last CACHED_BLOCK_HASHES hashes into masternode manager cache
static void LoadBlockHashesCache(CMasternodeMan& man)
{
Expand Down
3 changes: 3 additions & 0 deletions src/tiertwo/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
#include <string>

static const bool DEFAULT_MASTERNODE = false;
static const bool DEFAULT_MNCONFLOCK = true;

class CScheduler;
namespace boost {
class thread_group;
}

std::string GetTierTwoHelpString(bool showDebug);

/** Loads from disk all the tier two related objects */
bool LoadTierTwo(int chain_active_height, bool fReindexChainState);

Expand Down

0 comments on commit 918db4e

Please sign in to comment.