mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Added back logic to only allow X votes per masternode winner
This commit is contained in:
parent
8cbe280dd1
commit
ff06e58186
@ -662,12 +662,28 @@ bool CMasternodePaymentWinner::IsValid(CNode* pnode, std::string& strError)
|
||||
|
||||
bool CMasternodePayments::ProcessBlock(int nBlockHeight)
|
||||
{
|
||||
if(!fMasterNode) return false;
|
||||
// DETERMINE IF WE SHOULD BE VOTING FOR THE NEXT PAYEE
|
||||
|
||||
if(!fMasterNode) return false;
|
||||
|
||||
int n = mnodeman.GetMasternodeRank(activeMasternode.vin, nBlockHeight-100, MIN_MNW_PEER_PROTO_VERSION);
|
||||
|
||||
if(n == -1)
|
||||
{
|
||||
LogPrint("mnpayments", "CMasternodePayments::ProcessBlock - Unknown Masternode\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(n > MNPAYMENTS_SIGNATURES_TOTAL)
|
||||
{
|
||||
LogPrint("mnpayments", "CMasternodePayments::ProcessBlock - Masternode not in the top %d (%d)\n", MNPAYMENTS_SIGNATURES_TOTAL, n);
|
||||
return false;
|
||||
}
|
||||
|
||||
CMasternodePaymentWinner newWinner(activeMasternode.vin);
|
||||
|
||||
// LOCATE THE NEXT MASTERNODE WHICH SHOULD BE PAID
|
||||
|
||||
CMasternodePaymentWinner newWinner(activeMasternode.vin);
|
||||
{
|
||||
LogPrintf("CMasternodePayments::ProcessBlock() Start nHeight %d - vin %s. \n", nBlockHeight, activeMasternode.vin.ToString());
|
||||
|
||||
@ -694,6 +710,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
|
||||
}
|
||||
}
|
||||
|
||||
// SIGN MESSAGE TO NETWORK WITH OUR MASTERNODE KEYS
|
||||
|
||||
std::string errorMessage;
|
||||
CPubKey pubKeyMasternode;
|
||||
CKey keyMasternode;
|
||||
|
Loading…
Reference in New Issue
Block a user