only bump nTimeLast* when valid new/updated message arrived, do not bump on invalid or 'seen'
This commit is contained in:
parent
cfeda84a3c
commit
cc3b3a145e
@ -140,7 +140,6 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
|||||||
|
|
||||||
if(mapSeenGovernanceObjects.count(govobj.GetHash())){
|
if(mapSeenGovernanceObjects.count(govobj.GetHash())){
|
||||||
// TODO - print error code? what if it's GOVOBJ_ERROR_IMMATURE?
|
// TODO - print error code? what if it's GOVOBJ_ERROR_IMMATURE?
|
||||||
masternodeSync.AddedBudgetItem(govobj.GetHash());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,10 +188,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
|||||||
|
|
||||||
// IF WE'VE SEEN THIS OBJECT THEN SKIP
|
// IF WE'VE SEEN THIS OBJECT THEN SKIP
|
||||||
|
|
||||||
if(mapSeenVotes.count(vote.GetHash())){
|
if(mapSeenVotes.count(vote.GetHash())) return;
|
||||||
masternodeSync.AddedBudgetItem(vote.GetHash());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIND THE MASTERNODE OF THE VOTER
|
// FIND THE MASTERNODE OF THE VOTER
|
||||||
|
|
||||||
|
@ -316,7 +316,6 @@ void CMasternodePayments::ProcessMessage(CNode* pfrom, std::string& strCommand,
|
|||||||
|
|
||||||
if(mapMasternodePaymentVotes.count(vote.GetHash())) {
|
if(mapMasternodePaymentVotes.count(vote.GetHash())) {
|
||||||
LogPrint("mnpayments", "MASTERNODEPAYMENTVOTE -- hash=%s, nHeight=%d seen\n", vote.GetHash().ToString(), pCurrentBlockIndex->nHeight);
|
LogPrint("mnpayments", "MASTERNODEPAYMENTVOTE -- hash=%s, nHeight=%d seen\n", vote.GetHash().ToString(), pCurrentBlockIndex->nHeight);
|
||||||
masternodeSync.AddedPaymentVote();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +701,6 @@ int CMasternodeMan::GetEstimatedMasternodes(int nBlock)
|
|||||||
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb) {
|
void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb) {
|
||||||
mapSeenMasternodePing.insert(make_pair(mnb.lastPing.GetHash(), mnb.lastPing));
|
mapSeenMasternodePing.insert(make_pair(mnb.lastPing.GetHash(), mnb.lastPing));
|
||||||
mapSeenMasternodeBroadcast.insert(make_pair(mnb.GetHash(), mnb));
|
mapSeenMasternodeBroadcast.insert(make_pair(mnb.GetHash(), mnb));
|
||||||
masternodeSync.AddedMasternodeList();
|
|
||||||
|
|
||||||
LogPrintf("CMasternodeMan::UpdateMasternodeList() - addr: %s\n vin: %s\n", mnb.addr.ToString(), mnb.vin.ToString());
|
LogPrintf("CMasternodeMan::UpdateMasternodeList() - addr: %s\n vin: %s\n", mnb.addr.ToString(), mnb.vin.ToString());
|
||||||
|
|
||||||
@ -709,9 +708,11 @@ void CMasternodeMan::UpdateMasternodeList(CMasternodeBroadcast mnb) {
|
|||||||
if(pmn == NULL)
|
if(pmn == NULL)
|
||||||
{
|
{
|
||||||
CMasternode mn(mnb);
|
CMasternode mn(mnb);
|
||||||
Add(mn);
|
if(Add(mn)) {
|
||||||
} else {
|
masternodeSync.AddedMasternodeList();
|
||||||
pmn->UpdateFromNewBroadcast(mnb);
|
}
|
||||||
|
} else if(pmn->UpdateFromNewBroadcast(mnb)) {
|
||||||
|
masternodeSync.AddedMasternodeList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -720,7 +721,6 @@ bool CMasternodeMan::CheckMnbAndUpdateMasternodeList(CMasternodeBroadcast mnb, i
|
|||||||
LogPrint("masternode", "CMasternodeMan::CheckMnbAndUpdateMasternodeList - Masternode broadcast, vin: %s\n", mnb.vin.ToString());
|
LogPrint("masternode", "CMasternodeMan::CheckMnbAndUpdateMasternodeList - Masternode broadcast, vin: %s\n", mnb.vin.ToString());
|
||||||
|
|
||||||
if(mapSeenMasternodeBroadcast.count(mnb.GetHash())) { //seen
|
if(mapSeenMasternodeBroadcast.count(mnb.GetHash())) { //seen
|
||||||
masternodeSync.AddedMasternodeList();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
mapSeenMasternodeBroadcast.insert(make_pair(mnb.GetHash(), mnb));
|
mapSeenMasternodeBroadcast.insert(make_pair(mnb.GetHash(), mnb));
|
||||||
|
Loading…
Reference in New Issue
Block a user