This commit is contained in:
jl777
2017-03-16 19:17:06 +02:00
parent 3899eedf50
commit 87ce550306

View File

@@ -102,7 +102,10 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
if ( exception == 0 ) if ( exception == 0 )
{ {
numerator = (nValue / 20); // assumes 5%! numerator = (nValue / 20); // assumes 5%!
interest = (numerator / denominator); if ( txheight < 236000 )
interest = (numerator / denominator);
else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
} }
else else
{ {
@@ -113,9 +116,11 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
else else
{ {
numerator = (nValue * KOMODO_INTEREST); numerator = (nValue * KOMODO_INTEREST);
interest = (numerator / denominator) / COIN; if ( txheight < 300000 || numerator * minutes < 365 * 24 * 60 )
interest = (numerator / denominator) / COIN;
else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
} }
fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu)\n",(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator); //fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu)\n",(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator);
} }
} }
return(interest); return(interest);