From 5a8b8538e3bd08d42aae4fb6acfc33a97307c4e5 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 20 May 2015 20:21:44 +0300 Subject: [PATCH] Lock masternodes from masternode configuration file --- src/init.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 15825809f766..e809d3c5cf76 100755 --- a/src/init.cpp +++ b/src/init.cpp @@ -22,6 +22,7 @@ #include "util.h" #include "activemasternode.h" #include "masternodeman.h" +#include "masternodeconfig.h" #include "spork.h" #ifdef ENABLE_WALLET #include "db.h" @@ -342,6 +343,7 @@ std::string HelpMessage(HelpMessageMode hmm) strUsage += "\n" + _("Masternode options:") + "\n"; strUsage += " -masternode= " + _("Enable the client to act as a masternode (0-1, default: 0)") + "\n"; strUsage += " -mnconf= " + _("Specify masternode configuration file (default: masternode.conf)") + "\n"; + strUsage += " -mnconflock= " + _("Lock masternodes from masternode configuration file (default: 1)") + "\n"; strUsage += " -masternodeprivkey= " + _("Set the masternode private key") + "\n"; strUsage += " -masternodeaddr= " + _("Set external address:port to get to this masternode (example: address:port)") + "\n"; strUsage += " -masternodeminprotocol= " + _("Ignore masternodes less than version (example: 70050; default : 0)") + "\n"; @@ -1271,6 +1273,17 @@ bool AppInit2(boost::thread_group& threadGroup) } } + if(GetBoolArg("-mnconflock", true)) { + LogPrintf("Locking Masternodes:\n"); + uint256 mnTxHash; + BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { + LogPrintf(" %s %s\n", mne.getTxHash(), mne.getOutputIndex()); + mnTxHash.SetHex(mne.getTxHash()); + COutPoint outpoint = COutPoint(mnTxHash, boost::lexical_cast(mne.getOutputIndex())); + pwalletMain->LockCoin(outpoint); + } + } + fEnableDarksend = GetBoolArg("-enabledarksend", false); nDarksendRounds = GetArg("-darksendrounds", 2);