message: Minting: Prevent potential negative out values
diff: @@ -327,7 +327,20 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int64_t nFe
  //subtract mn payment from the stake reward
  if (!txNew.vout[1].IsZerocoinMint())
  + if (i == 2) {
  + // Majority of cases; do it quick and move on
  txNew.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++) {
  + txNew.vout[j].nValue -= mnPaymentSplit;
  + }
  + // in case it's not an even division, take the last bit of dust from the last one
  + txNew.vout[outputs].nValue -= mnPaymentRemainder;
  + }
  } else {
  txNew.vout.resize(2);
  txNew.vout[1].scriptPubKey = payee;
  