fix pubkey/donation conditions

This commit is contained in:
UdjinM6 2015-03-17 00:09:23 +03:00
parent c65adeb7d1
commit 567fe419d9

View File

@ -411,10 +411,10 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
newWinner.nBlockHeight = nBlockHeight; newWinner.nBlockHeight = nBlockHeight;
newWinner.vin = pmn->vin; newWinner.vin = pmn->vin;
if(pmn->donationPercentage > 0 && nHash % 100 > pmn->donationPercentage){ if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage) {
newWinner.payee.SetDestination(pmn->pubkey.GetID());
} else {
newWinner.payee.SetDestination(pmn->donationAddress.GetID()); newWinner.payee.SetDestination(pmn->donationAddress.GetID());
} else {
newWinner.payee.SetDestination(pmn->pubkey.GetID());
} }
} }
@ -434,9 +434,9 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
newWinner.vin = pmn->vin; newWinner.vin = pmn->vin;
if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage) { if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage) {
newWinner.payee.SetDestination(pmn->pubkey.GetID());
} else {
newWinner.payee.SetDestination(pmn->donationAddress.GetID()); newWinner.payee.SetDestination(pmn->donationAddress.GetID());
} else {
newWinner.payee.SetDestination(pmn->pubkey.GetID());
} }
break; // we found active MN break; // we found active MN