diff --git a/src/init.cpp b/src/init.cpp index 4171c19ee..ee305fe80 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1802,29 +1802,30 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } else { return InitError(_("You must specify a masternodeprivkey in the configuration. Please see documentation for help.")); } - } else { - LogPrintf("Using masternode config file %s\n", GetMasternodeConfigFile().string()); + } - if(GetBoolArg("-mnconflock", true) && pwalletMain) { - LOCK(pwalletMain->cs_wallet); - LogPrintf("Locking Masternodes:\n"); - uint256 mnTxHash; - int outputIndex; - BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { - mnTxHash.SetHex(mne.getTxHash()); - outputIndex = boost::lexical_cast(mne.getOutputIndex()); - COutPoint outpoint = COutPoint(mnTxHash, outputIndex); - // don't lock non-spendable outpoint (i.e. it's already spent or it's not from this wallet at all) - if(pwalletMain->IsMine(CTxIn(outpoint)) != ISMINE_SPENDABLE) { - LogPrintf(" %s %s - IS NOT SPENDABLE, was not locked\n", mne.getTxHash(), mne.getOutputIndex()); - continue; - } - pwalletMain->LockCoin(outpoint); - LogPrintf(" %s %s - locked successfully\n", mne.getTxHash(), mne.getOutputIndex()); + LogPrintf("Using masternode config file %s\n", GetMasternodeConfigFile().string()); + + if(GetBoolArg("-mnconflock", true) && pwalletMain && (masternodeConfig.getCount() > 0)) { + LOCK(pwalletMain->cs_wallet); + LogPrintf("Locking Masternodes:\n"); + uint256 mnTxHash; + int outputIndex; + BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { + mnTxHash.SetHex(mne.getTxHash()); + outputIndex = boost::lexical_cast(mne.getOutputIndex()); + COutPoint outpoint = COutPoint(mnTxHash, outputIndex); + // don't lock non-spendable outpoint (i.e. it's already spent or it's not from this wallet at all) + if(pwalletMain->IsMine(CTxIn(outpoint)) != ISMINE_SPENDABLE) { + LogPrintf(" %s %s - IS NOT SPENDABLE, was not locked\n", mne.getTxHash(), mne.getOutputIndex()); + continue; } + pwalletMain->LockCoin(outpoint); + LogPrintf(" %s %s - locked successfully\n", mne.getTxHash(), mne.getOutputIndex()); } } + nLiquidityProvider = GetArg("-liquidityprovider", nLiquidityProvider); nLiquidityProvider = std::min(std::max(nLiquidityProvider, 0), 100); darkSendPool.SetMinBlockSpacing(nLiquidityProvider * 15);