This commit is contained in:
jl777
2017-01-25 06:48:36 +02:00
parent 579d237442
commit d4a420a312

View File

@@ -75,7 +75,14 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
denominator = (((uint64_t)365 * 24 * 60) / minutes); denominator = (((uint64_t)365 * 24 * 60) / minutes);
if ( denominator == 0 ) if ( denominator == 0 )
denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually! denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually!
if ( nValue > 25000LL*COIN && txheight > 155949 ) if ( nValue > 25000LL*COIN )
{
if ( txheight <= 155949 )
{
printf(">>>>>>>>>>>> txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",txheight,(double)nValue/COIN,nLockTime,tiptime);
exception = 0;
}
if ( exception == 0 )
{ {
numerator = (nValue / 20); // assumes 5%! numerator = (nValue / 20); // assumes 5%!
interest = (numerator / denominator); interest = (numerator / denominator);
@@ -85,6 +92,12 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
numerator = (nValue * KOMODO_INTEREST); numerator = (nValue * KOMODO_INTEREST);
interest = (numerator / denominator) / COIN; interest = (numerator / denominator) / COIN;
} }
}
else
{
numerator = (nValue * KOMODO_INTEREST);
interest = (numerator / denominator) / 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);
} }
} }