Browse Source

Test

pull/4/head
jl777 7 years ago
parent
commit
3a7753af9c
  1. 10
      src/komodo_interest.h

10
src/komodo_interest.h

@ -110,11 +110,13 @@ 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
@ -126,12 +128,18 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
*/
numerator = (nValue * KOMODO_INTEREST);
if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 )
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%!

Loading…
Cancel
Save