Skip to content

Commit 904d788

Browse files
committed
Check New MasterNodeBroadcast Time
backport of #722
1 parent 93f5b6c commit 904d788

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/masternode.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,18 @@ bool CMasternodeBroadcast::CheckAndUpdate(int& nDos)
398398
//search existing Masternode list, this is where we update existing Masternodes with new mnb broadcasts
399399
CMasternode* pmn = mnodeman.Find(vin);
400400

401-
// no such masternode or it's not enabled already, nothing to update
402-
if(pmn == NULL || (pmn != NULL && !pmn->IsEnabled())) return true;
401+
// no such masternode, nothing to update
402+
if(pmn == NULL) return true ;
403+
else {
404+
// this broadcast older than we have, it's bad.
405+
if(pmn->sigTime > sigTime) {
406+
LogPrintf("mnb - Bad sigTime %d for Masternode %20s %105s (existing broadcast is at %d)\n",
407+
sigTime, addr.ToString(), vin.ToString(), pmn->sigTime);
408+
return false;
409+
}
410+
// masternode is not enabled yet/already, nothing to update
411+
if(!pmn->IsEnabled()) return true;
412+
}
403413

404414
// mn.pubkey = pubkey, IsVinAssociatedWithPubkey is validated once below,
405415
// after that they just need to match

0 commit comments

Comments
 (0)