Skip to content

Commit

Permalink
Check New MasterNodeBroadcast Time (#833)
Browse files Browse the repository at this point in the history
backport of #722
  • Loading branch information
thelazier authored and schinzelh committed May 30, 2016
1 parent 93f5b6c commit 267502f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/masternode.cpp
Expand Up @@ -398,8 +398,18 @@ bool CMasternodeBroadcast::CheckAndUpdate(int& nDos)
//search existing Masternode list, this is where we update existing Masternodes with new mnb broadcasts
CMasternode* pmn = mnodeman.Find(vin);

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

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

0 comments on commit 267502f

Please sign in to comment.