@@ -219,14 +219,18 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
219
219
220
220
govobj.UpdateSentinelVariables (); // this sets local vars in object
221
221
222
- if (AddGovernanceObject (govobj, pfrom))
222
+ bool fAddToSeen = true ;
223
+ if (AddGovernanceObject (govobj, fAddToSeen , pfrom))
223
224
{
224
225
LogPrintf (" MNGOVERNANCEOBJECT -- %s new\n " , strHash);
225
226
govobj.Relay ();
226
227
}
227
228
228
- // UPDATE THAT WE'VE SEEN THIS OBJECT
229
- mapSeenGovernanceObjects.insert (std::make_pair (nHash, SEEN_OBJECT_IS_VALID));
229
+ if (fAddToSeen ) {
230
+ // UPDATE THAT WE'VE SEEN THIS OBJECT
231
+ mapSeenGovernanceObjects.insert (std::make_pair (nHash, SEEN_OBJECT_IS_VALID));
232
+ }
233
+
230
234
masternodeSync.AddedGovernanceItem ();
231
235
232
236
@@ -305,13 +309,15 @@ void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj, CGovernance
305
309
fRateChecksEnabled = true ;
306
310
}
307
311
308
- bool CGovernanceManager::AddGovernanceObject (CGovernanceObject& govobj, CNode* pfrom)
312
+ bool CGovernanceManager::AddGovernanceObject (CGovernanceObject& govobj, bool & fAddToSeen , CNode* pfrom)
309
313
{
310
314
LOCK2 (cs_main, cs);
311
315
std::string strError = " " ;
312
316
313
317
DBG ( cout << " CGovernanceManager::AddGovernanceObject START" << endl; );
314
318
319
+ fAddToSeen = true ;
320
+
315
321
uint256 nHash = govobj.GetHash ();
316
322
317
323
// MAKE SURE THIS OBJECT IS OK
@@ -341,6 +347,8 @@ bool CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, CNode* p
341
347
}
342
348
343
349
if (!UpdateCurrentWatchdog (govobj)) {
350
+ // Allow wd's which are not current to be reprocessed
351
+ fAddToSeen = false ;
344
352
if (pfrom && (nHashWatchdogCurrent != uint256 ())) {
345
353
pfrom->PushInventory (CInv (MSG_GOVERNANCE_OBJECT, nHashWatchdogCurrent));
346
354
}
@@ -1007,7 +1015,8 @@ void CGovernanceManager::CheckMasternodeOrphanObjects()
1007
1015
continue ;
1008
1016
}
1009
1017
1010
- if (AddGovernanceObject (govobj)) {
1018
+ bool fAddToSeen = true ;
1019
+ if (AddGovernanceObject (govobj, fAddToSeen )) {
1011
1020
LogPrintf (" CGovernanceManager::CheckMasternodeOrphanObjects -- %s new\n " , govobj.GetHash ().ToString ());
1012
1021
govobj.Relay ();
1013
1022
mapMasternodeOrphanObjects.erase (it++);
0 commit comments