Force txindex when a Mastenode

This commit is contained in:
Evan Duffield 2015-07-16 03:00:16 -07:00
parent e65a1edce3
commit 3c8b335594
2 changed files with 14 additions and 0 deletions

View File

@ -1457,6 +1457,12 @@ bool AppInit2(boost::thread_group& threadGroup)
fMasterNode = GetBoolArg("-masternode", false);
if((fMasterNode || masternodeConfig.getCount() > -1) && fTxIndex == false) {
return InitError("Enabling Masternode support requires turning on transaction indexing."
"Please add txindex=1 to your configuration and start with --reindex=1");
}
if(fMasterNode) {
LogPrintf("IS DARKSEND MASTER NODE\n");
strMasterNodeAddr = GetArg("-masternodeaddr", "");

View File

@ -91,6 +91,14 @@ public:
return entries;
}
int getCount() {
int c = -1;
BOOST_FOREACH(CMasternodeEntry e, entries) {
if(e.getAlias() != "") c++;
}
return c;
}
private:
std::vector<CMasternodeEntry> entries;