message: allow up to 1000 free bytes for coinstake transaction
diff: @@ -1513,7 +1513,8 @@ bool CTransaction::CheckInputs(CValidationState &state, CCoinsViewCache &inputs,
  if (!GetCoinAge(state, inputs, nCoinAge))
  return error("CheckInputs() : %s unable to get coin age for coinstake", GetHash().ToString().c_str());
  int64 nStakeReward = GetValueOut() - nValueIn;
  - if (nStakeReward > GetProofOfStakeReward(nCoinAge) - GetMinFee() + (IsProtocolV07(nTime) ? MIN_TX_FEE : PERKB_TX_FEE))
  + int64 nCoinstakeCost = (GetMinFee() < PERKB_TX_FEE)? 0 : (GetMinFee() - PERKB_TX_FEE);
  + if (nStakeReward > GetProofOfStakeReward(nCoinAge) - nCoinstakeCost)
  return state.DoS(100, error("CheckInputs() : %s stake reward exceeded", GetHash().ToString().c_str()));
  }
  else
  @@ -2381,7 +2382,11 @@ bool CBlock::CheckBlock(CValidationState &state, bool fCheckPOW, bool fCheckMerk
  return state.DoS(50, error("CheckBlock() : coinstake timestamp violation nTimeBlock=%" PRI64u" nTimeTx=%u", GetBlockTime(), vtx[1].nTime));
  // Check coinbase reward
  - if (vtx[0].GetValueOut() > (IsProofOfWork()? (GetProofOfWorkReward(nBits) - vtx[0].GetMinFee() + (IsProtocolV07(vtx[0].nTime) ? MIN_TX_FEE : PERKB_TX_FEE)) : 0))
  + int64 nCoinbaseCost = 0;
  + if (IsProofOfWork())
  + nCoinbaseCost = (vtx[0].GetMinFee() < PERKB_TX_FEE)? 0 : (vtx[0].GetMinFee() - PERKB_TX_FEE);
  +
  + if (vtx[0].GetValueOut() > (IsProofOfWork()? (GetProofOfWorkReward(nBits) - nCoinbaseCost) : 0))
  return state.DoS(50, error("CheckBlock() : coinbase reward exceeded %s > %s",
  FormatMoney(vtx[0].GetValueOut()).c_str(),
  FormatMoney(IsProofOfWork()? GetProofOfWorkReward(nBits) : 0).c_str()));
  