int64 static GetBlockValue(int nHeight, int64 nFees)
{
int64 nSubsidy = 512 * COIN;
int halvingInterval = 43200;
int halvingGap = 86400; // Num of blocks between 1st and second halving
while (nHeight > halvingInterval) {
nSubsidy /= 2;
halvingInterval += halvingGap;
halvingGap += 43200; // Next halving height gap is 43,200 blocks more than the last
}
return nSubsidy + nFees;
}
Umm...