This commit is contained in:
jl777
2017-03-26 16:32:59 +03:00
parent 3a7753af9c
commit cf99cfc1eb

View File

@@ -67,7 +67,7 @@ uint64_t komodo_moneysupply(int32_t height)
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
{
int32_t minutes,exception; uint64_t numerator,denominator,interest = 0; uint32_t activation;
activation = 1490531630; // 1491350400 5th April
activation = 1491350400; // 1491350400 5th April
if ( ASSETCHAINS_SYMBOL[0] != 0 )
return(0);
if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN )
@@ -110,13 +110,11 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
if ( txheight < 250000 )
interest = (numerator / denominator);
else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
fprintf(stderr,">25000 KMD\n");
}
else
{
numerator = (nValue * KOMODO_INTEREST);
interest = (numerator / denominator) / COIN;
fprintf(stderr,"exception\n");
}
}
else
@@ -129,17 +127,11 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
*/
numerator = (nValue * KOMODO_INTEREST);
if ( (txheight < 250000 && tiptime < activation) || numerator * minutes < 365 * 24 * 60 )
{
interest = (numerator / denominator) / COIN;
fprintf(stderr,"txheight < 250000 || numerator * minutes < 365 * 24 * 60\n");
}
else
{
if ( tiptime < activation )
{
interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
fprintf(stderr,"tiptime < activation\n");
}
else
{
numerator = (nValue / 20); // assumes 5%!
@@ -147,7 +139,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes);
}
}
if ( numerator == (nValue * KOMODO_INTEREST) )
if ( 0 && numerator == (nValue * KOMODO_INTEREST) )
fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes));
}
}