From 918db4eec23b90f28824b5bc0175b2d973c5af8e Mon Sep 17 00:00:00 2001 From: furszy Date: Fri, 14 Jan 2022 12:02:04 -0300 Subject: [PATCH] init: move Masternode arguments inside tiertwo/init GetTierTwoHelpString --- src/init.cpp | 10 +--------- src/tiertwo/init.cpp | 13 +++++++++++++ src/tiertwo/init.h | 3 +++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 1e5be6a3f14cf..57a874866382e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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 g_connman; std::unique_ptr peerLogic; @@ -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=", strprintf("Enable the client to act as a masternode (0-1, default: %u)", DEFAULT_MASTERNODE)); - strUsage += HelpMessageOpt("-mnconf=", strprintf("Specify masternode configuration file (default: %s)", PIVX_MASTERNODE_CONF_FILENAME)); - strUsage += HelpMessageOpt("-mnconflock=", strprintf("Lock masternodes from masternode configuration file (default: %u)", DEFAULT_MNCONFLOCK)); - strUsage += HelpMessageOpt("-masternodeprivkey=", "Set the masternode private key"); - strUsage += HelpMessageOpt("-masternodeaddr=", strprintf("Set external address:port to get to this masternode (example: %s)", "128.127.106.235:51472")); - strUsage += HelpMessageOpt("-budgetvotemode=", "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=", "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." diff --git a/src/tiertwo/init.cpp b/src/tiertwo/init.cpp index 99e725b55df0f..a6f9a2297c308 100644 --- a/src/tiertwo/init.cpp +++ b/src/tiertwo/init.cpp @@ -16,6 +16,19 @@ #include +std::string GetTierTwoHelpString(bool showDebug) +{ + std::string strUsage = HelpMessageGroup("Masternode options:"); + strUsage += HelpMessageOpt("-masternode=", strprintf("Enable the client to act as a masternode (0-1, default: %u)", DEFAULT_MASTERNODE)); + strUsage += HelpMessageOpt("-mnconf=", strprintf("Specify masternode configuration file (default: %s)", PIVX_MASTERNODE_CONF_FILENAME)); + strUsage += HelpMessageOpt("-mnconflock=", strprintf("Lock masternodes from masternode configuration file (default: %u)", DEFAULT_MNCONFLOCK)); + strUsage += HelpMessageOpt("-masternodeprivkey=", "Set the masternode private key"); + strUsage += HelpMessageOpt("-masternodeaddr=", strprintf("Set external address:port to get to this masternode (example: %s)", "128.127.106.235:51472")); + strUsage += HelpMessageOpt("-budgetvotemode=", "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=", "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) { diff --git a/src/tiertwo/init.h b/src/tiertwo/init.h index 3c11096f392ed..bb20e86729c8a 100644 --- a/src/tiertwo/init.h +++ b/src/tiertwo/init.h @@ -8,12 +8,15 @@ #include 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);