Edit: Can you guys confirm if your POS earned per day is less than expected? Here is the code I believe is causing the problem:
int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365 / COIN;
Should really be:
int64_t nSubsidy = nCoinAge * nRewardCoinYear / 365;
if the nCoinAge is expressed in days, then the second formula is fine. Otherwise we will have problems as interest rate is scaled to days.
the first formula may be thus correct, if COIN is the scaling factor. Double check that.
It seems FIND has nCoinAge calculated as follows:
CBigNum bnCoinDay = bnCentSecond * CENT / (24 * 60 * 60);
if (fDebug && GetBoolArg("-printcoinage"))
printf("coin age bnCoinDay=%s\n", bnCoinDay.ToString().c_str());
nCoinAge = bnCoinDay.getuint64();
While the second example (HyperStake) has it like this:
CBigNum bnCoinDay = bnCentSecond * CENT / COIN / (24 * 60 * 60);
if (fDebug && GetBoolArg("-printcoinage"))
printf("coin age bnCoinDay=%s\n", bnCoinDay.ToString().c_str());
nCoinAge = bnCoinDay.getuint64();
So at the moment I'm not sure where the mistake could be as they both divide by COIN, but FIND does it later in the calculation.
ok, let's see if I can help with this one.
Both formulas lead to the same solution, the difference however is the order of operations.
in the first version you have division by COIN after converting to int, in the second before.
That may have importance.