mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
drop -masternodeminprotocol/nMasternodeMinProtocol, use masternodePayments.GetMinMasternodePaymentsProto()
This commit is contained in:
parent
5f9c676e05
commit
753297ea99
@ -415,7 +415,6 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += " -mnconflock=<n> " + strprintf(_("Lock masternodes from masternode configuration file (default: %u)"), 1) + "\n";
|
||||
strUsage += " -masternodeprivkey=<n> " + _("Set the masternode private key") + "\n";
|
||||
strUsage += " -masternodeaddr=<n> " + _("Set external address:port to get to this masternode (example: address:port)") + "\n";
|
||||
strUsage += " -masternodeminprotocol=<n> " + strprintf(_("Ignore masternodes less than version (example: 70050; default: %u)"), masternodePayments.GetMinMasternodePaymentsProto()) + "\n";
|
||||
strUsage += " -budgetvotemode=<mode> " + _("Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)") + "\n";
|
||||
|
||||
strUsage += "\n" + _("Darksend options:") + "\n";
|
||||
@ -868,9 +867,6 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
return InitError(_("Unable to sign spork message, wrong key?"));
|
||||
}
|
||||
|
||||
//ignore masternodes below protocol version
|
||||
nMasternodeMinProtocol = GetArg("-masternodeminprotocol", masternodePayments.GetMinMasternodePaymentsProto());
|
||||
|
||||
/* Start the RPC server already. It will be started in "warmup" mode
|
||||
* and not really process calls already (but it will signify connections
|
||||
* that the server is there and will be ready later). Warmup mode will
|
||||
|
@ -118,7 +118,7 @@ void CMasternodeSync::Process()
|
||||
//don't begin syncing until we're almost at a recent block
|
||||
if(pindexPrev->nHeight + 4 < pindexBestHeader->nHeight && pindexPrev->nTime + 600 < GetTime()) return;
|
||||
|
||||
if (pnode->nVersion >= nMasternodeMinProtocol) {
|
||||
if (pnode->nVersion >= masternodePayments.GetMinMasternodePaymentsProto()) {
|
||||
|
||||
if(RequestedMasternodeAssets == MASTERNODE_SYNC_LIST) {
|
||||
if(fDebug) LogPrintf("CMasternodeSync::Process() - lastMasternodeList %lld (GetTime() - MASTERNODE_SYNC_TIMEOUT) %lld\n", lastMasternodeList, GetTime() - MASTERNODE_SYNC_TIMEOUT);
|
||||
@ -137,9 +137,7 @@ void CMasternodeSync::Process()
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pnode->nVersion >= masternodePayments.GetMinMasternodePaymentsProto()) {
|
||||
if(RequestedMasternodeAssets == MASTERNODE_SYNC_MNW) {
|
||||
if(lastMasternodeWinner > 0 && lastMasternodeWinner < GetTime() - MASTERNODE_SYNC_TIMEOUT){ //hasn't received a new item in the last five seconds, so we'll move to the
|
||||
GetNextAsset();
|
||||
|
@ -302,7 +302,7 @@ bool CMasternodeBroadcast::CheckAndUpdate(int& nDos)
|
||||
std::string vchPubKey2(pubkey2.begin(), pubkey2.end());
|
||||
std::string strMessage = addr.ToString() + boost::lexical_cast<std::string>(sigTime) + vchPubKey + vchPubKey2 + boost::lexical_cast<std::string>(protocolVersion);
|
||||
|
||||
if(protocolVersion < nMasternodeMinProtocol) {
|
||||
if(protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) {
|
||||
LogPrintf("mnb - ignoring outdated Masternode %s protocol version %d\n", vin.ToString().c_str(), protocolVersion);
|
||||
return false;
|
||||
}
|
||||
@ -516,7 +516,7 @@ bool CMasternodePing::CheckAndUpdate(int& nDos)
|
||||
|
||||
// see if we have this Masternode
|
||||
CMasternode* pmn = mnodeman.Find(vin);
|
||||
if(pmn != NULL && pmn->IsEnabled() && pmn->protocolVersion >= nMasternodeMinProtocol)
|
||||
if(pmn != NULL && pmn->IsEnabled() && pmn->protocolVersion >= masternodePayments.GetMinMasternodePaymentsProto())
|
||||
{
|
||||
// LogPrintf("mnping - Found corresponding mn for vin: %s\n", vin.ToString().c_str());
|
||||
// update only if there is no known ping for this masternode or
|
||||
|
@ -239,7 +239,7 @@ void CMasternodeMan::CheckAndRemove(bool forceExpiredRemoval)
|
||||
if((*it).activeState == CMasternode::MASTERNODE_REMOVE ||
|
||||
(*it).activeState == CMasternode::MASTERNODE_VIN_SPENT ||
|
||||
(forceExpiredRemoval && (*it).activeState == CMasternode::MASTERNODE_EXPIRED) ||
|
||||
(*it).protocolVersion < nMasternodeMinProtocol) {
|
||||
(*it).protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) {
|
||||
if(fDebug) LogPrintf("CMasternodeMan: Removing inactive Masternode %s - %i now\n", (*it).addr.ToString().c_str(), size() - 1);
|
||||
it = vMasternodes.erase(it);
|
||||
} else {
|
||||
@ -292,6 +292,7 @@ void CMasternodeMan::Clear()
|
||||
int CMasternodeMan::CountEnabled(int protocolVersion)
|
||||
{
|
||||
int i = 0;
|
||||
protocolVersion = protocolVersion == -1 ? masternodePayments.GetMinMasternodePaymentsProto() : protocolVersion;
|
||||
|
||||
BOOST_FOREACH(CMasternode& mn, vMasternodes) {
|
||||
mn.Check();
|
||||
@ -378,7 +379,7 @@ CMasternode* CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeight
|
||||
if(masternodePayments.IsScheduled(mn, nBlockHeight)) continue;
|
||||
|
||||
//make sure it has as many confirmations as there are masternodes
|
||||
if(mn.GetMasternodeInputAge() < CountEnabled(masternodePayments.GetMinMasternodePaymentsProto())) continue;
|
||||
if(mn.GetMasternodeInputAge() < CountEnabled()) continue;
|
||||
|
||||
if(pOldestMasternode == NULL || pOldestMasternode->SecondsSincePayment() < mn.SecondsSincePayment()){
|
||||
pOldestMasternode = &mn;
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
/// Clear Masternode vector
|
||||
void Clear();
|
||||
|
||||
int CountEnabled(int protocolVersion = nMasternodeMinProtocol);
|
||||
int CountEnabled(int protocolVersion = -1);
|
||||
|
||||
void DsegUpdate(CNode* pnode);
|
||||
|
||||
|
@ -113,7 +113,6 @@ int nAnonymizeDarkcoinAmount = 1000;
|
||||
int nLiquidityProvider = 0;
|
||||
/** Spork enforcement enabled time */
|
||||
int64_t enforceMasternodePaymentsTime = 4085657524;
|
||||
int nMasternodeMinProtocol = 0;
|
||||
bool fSucessfullyLoaded = false;
|
||||
bool fEnableDarksend = false;
|
||||
/** All denominations used by darksend */
|
||||
|
@ -39,7 +39,6 @@ extern int nLiquidityProvider;
|
||||
extern bool fEnableDarksend;
|
||||
extern int64_t enforceMasternodePaymentsTime;
|
||||
extern std::string strMasterNodeAddr;
|
||||
extern int nMasternodeMinProtocol;
|
||||
extern int keysLoaded;
|
||||
extern bool fSucessfullyLoaded;
|
||||
extern std::vector<int64_t> darkSendDenominations;
|
||||
|
Loading…
Reference in New Issue
Block a user