From 8afc8328d84f6eafafa0c54a06fa3d4826c1dc5f Mon Sep 17 00:00:00 2001 From: random-zebra Date: Mon, 1 Mar 2021 19:04:36 +0100 Subject: [PATCH] [Cleanup] Remove IsZerocoinMint check in FillBlockPayee --- src/masternode-payments.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 607ec297dceed..7238c08190c21 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -338,21 +338,19 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txCoinbase, CMutab txCoinstake.vout[i].nValue = masternodePayment; //subtract mn payment from the stake reward - if (!txCoinstake.vout[1].IsZerocoinMint()) { - if (i == 2) { - // Majority of cases; do it quick and move on - txCoinstake.vout[i - 1].nValue -= masternodePayment; - } else if (i > 2) { - // special case, stake is split between (i-1) outputs - unsigned int outputs = i-1; - CAmount mnPaymentSplit = masternodePayment / outputs; - CAmount mnPaymentRemainder = masternodePayment - (mnPaymentSplit * outputs); - for (unsigned int j=1; j<=outputs; j++) { - txCoinstake.vout[j].nValue -= mnPaymentSplit; - } - // in case it's not an even division, take the last bit of dust from the last one - txCoinstake.vout[outputs].nValue -= mnPaymentRemainder; + if (i == 2) { + // Majority of cases; do it quick and move on + txCoinstake.vout[i - 1].nValue -= masternodePayment; + } else if (i > 2) { + // special case, stake is split between (i-1) outputs + unsigned int outputs = i-1; + CAmount mnPaymentSplit = masternodePayment / outputs; + CAmount mnPaymentRemainder = masternodePayment - (mnPaymentSplit * outputs); + for (unsigned int j=1; j<=outputs; j++) { + txCoinstake.vout[j].nValue -= mnPaymentSplit; } + // in case it's not an even division, take the last bit of dust from the last one + txCoinstake.vout[outputs].nValue -= mnPaymentRemainder; } } else { txCoinbase.vout.resize(2);