mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
Merge pull request #427 from UdjinM6/v0.12.0.x_change_sync_activemn_start
V0.12.0.x Start all DS, mnodeman, IX related checks and activate mn only after sync is over
This commit is contained in:
commit
eb9aa2cb87
@ -2333,27 +2333,6 @@ void ThreadCheckDarkSendPool()
|
||||
MilliSleep(1000);
|
||||
//LogPrintf("ThreadCheckDarkSendPool::check timeout\n");
|
||||
|
||||
darkSendPool.CheckTimeout();
|
||||
darkSendPool.CheckForCompleteQueue();
|
||||
|
||||
if(c % 60 == 0)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
/*
|
||||
cs_main is required for doing CMasternode.Check because something
|
||||
is modifying the coins view without a mempool lock. It causes
|
||||
segfaults from this code without the cs_main lock.
|
||||
*/
|
||||
mnodeman.CheckAndRemove();
|
||||
mnodeman.ProcessMasternodeConnections();
|
||||
masternodePayments.CleanPaymentList();
|
||||
CleanTransactionLocksList();
|
||||
}
|
||||
|
||||
if(c % MASTERNODE_PING_SECONDS == 0) activeMasternode.ManageStatus();
|
||||
|
||||
if(c % MASTERNODES_DUMP_SECONDS == 0) DumpMasternodes();
|
||||
|
||||
//try to sync the Masternode list and payment list every 5 seconds from at least 3 nodes
|
||||
if(c % 5 == 0 && RequestedMasternodeAssets <= 5){
|
||||
bool fIsInitialDownload = IsInitialBlockDownload();
|
||||
@ -2401,18 +2380,43 @@ void ThreadCheckDarkSendPool()
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(c % 60 == 0 && RequestedMasternodeAssets == 3){
|
||||
RequestedMasternodeAssets = MASTERNODE_LIST_SYNCED; //done syncing
|
||||
} else if((c % 60 == 0 && RequestedMasternodeAssets >= 5 && RequestedMasternodeAssets < MASTERNODE_LIST_SYNCED) || //done syncing
|
||||
(c % (5 * 60) == 0 && RequestedMasternodeAssets < 5)) { //couldn't find 5 peers in 5 minutes
|
||||
RequestedMasternodeAssets = MASTERNODE_LIST_SYNCED;
|
||||
c = 1; // reset counter
|
||||
}
|
||||
|
||||
if(c % 60 == 0){
|
||||
//if we've used 1/5 of the Masternode list, then clear the list.
|
||||
if((int)vecMasternodesUsed.size() > (int)mnodeman.size() / 5)
|
||||
vecMasternodesUsed.clear();
|
||||
}
|
||||
if(RequestedMasternodeAssets == MASTERNODE_LIST_SYNCED) {
|
||||
if(c % MASTERNODE_PING_SECONDS == 1) activeMasternode.ManageStatus(); // activate right after sync
|
||||
|
||||
if(darkSendPool.GetState() == POOL_STATUS_IDLE && c % 6 == 0){
|
||||
darkSendPool.DoAutomaticDenominating();
|
||||
if(c % 60 == 0)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
/*
|
||||
cs_main is required for doing CMasternode.Check because something
|
||||
is modifying the coins view without a mempool lock. It causes
|
||||
segfaults from this code without the cs_main lock.
|
||||
*/
|
||||
mnodeman.CheckAndRemove();
|
||||
mnodeman.ProcessMasternodeConnections();
|
||||
masternodePayments.CleanPaymentList();
|
||||
CleanTransactionLocksList();
|
||||
}
|
||||
|
||||
if(c % 60 == 0){
|
||||
//if we've used 1/5 of the Masternode list, then clear the list.
|
||||
if((int)vecMasternodesUsed.size() > (int)mnodeman.size() / 5)
|
||||
vecMasternodesUsed.clear();
|
||||
}
|
||||
|
||||
if(c % MASTERNODES_DUMP_SECONDS == 0) DumpMasternodes();
|
||||
|
||||
darkSendPool.CheckTimeout();
|
||||
darkSendPool.CheckForCompleteQueue();
|
||||
|
||||
if(darkSendPool.GetState() == POOL_STATUS_IDLE && c % 6 == 0){
|
||||
darkSendPool.DoAutomaticDenominating();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1490,7 +1490,6 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
return InitError(_("You must specify a masternodeprivkey in the configuration. Please see documentation for help."));
|
||||
}
|
||||
|
||||
if(Params().NetworkID() != CBaseChainParams::REGTEST) activeMasternode.ManageStatus();
|
||||
}
|
||||
|
||||
if(GetBoolArg("-mnconflock", true)) {
|
||||
|
Loading…
Reference in New Issue
Block a user