Skip to content

Commit

Permalink
Move masternodeconfig initialization to tiertwo/init
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Jan 31, 2022
1 parent bedf4de commit 083fcad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
7 changes: 0 additions & 7 deletions src/pivxd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ bool AppInit(int argc, char* argv[])
return false;
}

// parse masternode.conf
std::string strErr;
if (!masternodeConfig.read(strErr)) {
fprintf(stderr, "Error reading masternode configuration file: %s\n", strErr.c_str());
return false;
}

// Error out when loose non-argument tokens are encountered on command line
for (int i = 1; i < argc; i++) {
if (!IsSwitchChar(argv[i][0])) {
Expand Down
9 changes: 0 additions & 9 deletions src/qt/pivx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "fs.h"
#include "guiinterface.h"
#include "init.h"
#include "masternodeconfig.h"
#include "net.h"
#include "qt/clientmodel.h"
#include "qt/guiconstants.h"
Expand Down Expand Up @@ -654,14 +653,6 @@ int main(int argc, char* argv[])
app.updateTranslation();

#ifdef ENABLE_WALLET
/// 7a. parse masternode.conf
std::string strErr;
if (!masternodeConfig.read(strErr)) {
QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error reading masternode configuration file: %1").arg(strErr.c_str()));
return 0;
}

/// 8. URI IPC sending
// - Do this early as we don't want to bother initializing if we are just calling IPC
// - Do this *after* setting up the data directory, as the data directory hash is used in the name
Expand Down
8 changes: 8 additions & 0 deletions src/tiertwo/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ bool LoadTierTwo(int chain_active_height, bool fReindexChainState)
LogPrintf("Error reading mnpayments.dat - cached data discarded\n");
}

// ###################################### //
// ## Legacy Parse 'masternodes.conf' ## //
// ###################################### //
std::string strErr;
if (!masternodeConfig.read(strErr)) {
return UIError(strprintf(_("Error reading masternode configuration file: %s"), strErr));
}

// ############################## //
// ## Net MNs Metadata Manager ## //
// ############################## //
Expand Down

0 comments on commit 083fcad

Please sign in to comment.