From 567fe419d91a265881bca85aec90937f6114d115 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 17 Mar 2015 00:09:23 +0300 Subject: [PATCH] fix pubkey/donation conditions --- src/masternode.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index 776c71fab3..9aa0ea7aba 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -411,10 +411,10 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) newWinner.nBlockHeight = nBlockHeight; newWinner.vin = pmn->vin; - if(pmn->donationPercentage > 0 && nHash % 100 > pmn->donationPercentage){ - newWinner.payee.SetDestination(pmn->pubkey.GetID()); - } else { + if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage) { newWinner.payee.SetDestination(pmn->donationAddress.GetID()); + } else { + newWinner.payee.SetDestination(pmn->pubkey.GetID()); } } @@ -433,10 +433,10 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) newWinner.nBlockHeight = nBlockHeight; newWinner.vin = pmn->vin; - if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage){ - newWinner.payee.SetDestination(pmn->pubkey.GetID()); - } else { + if(pmn->donationPercentage > 0 && nHash % 100 < pmn->donationPercentage) { newWinner.payee.SetDestination(pmn->donationAddress.GetID()); + } else { + newWinner.payee.SetDestination(pmn->pubkey.GetID()); } break; // we found active MN