Commit 12d826f5 authored by UdjinM6's avatar UdjinM6
Browse files

Force sync progress:

If it's already more then MASTERNODE_SYNC_TIMEOUT seconds passed since we asked
and we still have nothing, assume there is nothing to sync but give it another
MASTERNODE_SYNC_TIMEOUT seconds until we move further
parent 65b87180
Showing with 27 additions and 1 deletion
+27 -1
......@@ -131,6 +131,14 @@ void CMasternodeSync::Process()
return;
}
// If it's already more then MASTERNODE_SYNC_TIMEOUT seconds passed since we asked
// and we still have nothing, assume there is nothing to sync but give it another
// MASTERNODE_SYNC_TIMEOUT seconds until we move further
static int64_t lastTimeAsked = 0;
if(lastMasternodeList == 0 && lastTimeAsked > 0 && lastTimeAsked < GetTime() - MASTERNODE_SYNC_TIMEOUT) {
lastMasternodeList = GetTime();
}
if(pnode->HasFulfilledRequest("mnsync")) continue;
pnode->FulfilledRequest("mnsync");
......@@ -138,6 +146,7 @@ void CMasternodeSync::Process()
&& RequestedMasternodeAttempt <= 2){
mnodeman.DsegUpdate(pnode);
RequestedMasternodeAttempt++;
lastTimeAsked = GetTime();
}
return;
}
......@@ -148,6 +157,14 @@ void CMasternodeSync::Process()
return;
}
// If it's already more then MASTERNODE_SYNC_TIMEOUT seconds passed since we asked
// and we still have nothing, assume there is nothing to sync but give it another
// MASTERNODE_SYNC_TIMEOUT seconds until we move further
static int64_t lastTimeAsked = 0;
if(lastMasternodeWinner == 0 && lastTimeAsked > 0 && lastTimeAsked < GetTime() - MASTERNODE_SYNC_TIMEOUT) {
lastMasternodeWinner = GetTime();
}
if(pnode->HasFulfilledRequest("mnwsync")) continue;
pnode->FulfilledRequest("mnwsync");
......@@ -155,6 +172,7 @@ void CMasternodeSync::Process()
&& RequestedMasternodeAttempt <= 2){
pnode->PushMessage("mnget"); //sync payees
RequestedMasternodeAttempt++;
lastTimeAsked = GetTime();
}
return;
}
......@@ -168,15 +186,23 @@ void CMasternodeSync::Process()
return;
}
// If it's already more then MASTERNODE_SYNC_TIMEOUT seconds passed since we asked
// and we still have nothing, assume there is nothing to sync but give it another
// MASTERNODE_SYNC_TIMEOUT seconds until we move further
static int64_t lastTimeAsked = 0;
if(lastBudgetItem == 0 && lastTimeAsked > 0 && lastTimeAsked < GetTime() - MASTERNODE_SYNC_TIMEOUT) {
lastBudgetItem = GetTime();
}
if(pnode->HasFulfilledRequest("busync")) continue;
pnode->FulfilledRequest("busync");
if((lastBudgetItem == 0 || lastBudgetItem > GetTime() - MASTERNODE_SYNC_TIMEOUT)
&& RequestedMasternodeAttempt <= 2){
uint256 n = 0;
pnode->PushMessage("mnvs", n); //sync masternode votes
RequestedMasternodeAttempt++;
lastTimeAsked = GetTime();
}
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment