Payout and enforce operator reward payments

This commit is contained in:
Alexander Block 2018-03-16 15:08:14 +01:00
parent 2c481f0f86
commit 60002b7ddb

View File

@ -588,7 +588,15 @@ bool CMasternodePayments::GetBlockTxOuts(int nBlockHeight, CAmount blockReward,
if (!dmnPayee) { if (!dmnPayee) {
return false; return false;
} }
voutMasternodePaymentsRet.emplace_back(masternodeReward, dmnPayee->pdmnState->scriptPayout);
if (dmnPayee->nOperatorReward == 0 || dmnPayee->pdmnState->scriptOperatorPayout == CScript()) {
voutMasternodePaymentsRet.emplace_back(masternodeReward, dmnPayee->pdmnState->scriptPayout);
} else {
CAmount operatorReward = (masternodeReward * dmnPayee->nOperatorReward) / 10000;
masternodeReward -= operatorReward;
voutMasternodePaymentsRet.emplace_back(masternodeReward, dmnPayee->pdmnState->scriptPayout);
voutMasternodePaymentsRet.emplace_back(operatorReward, dmnPayee->pdmnState->scriptOperatorPayout);
}
return true; return true;
} else { } else {
LOCK(cs_mapMasternodeBlocks); LOCK(cs_mapMasternodeBlocks);