Test
This commit is contained in:
@@ -66,7 +66,8 @@ uint64_t komodo_moneysupply(int32_t height)
|
|||||||
|
|
||||||
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
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;
|
int32_t minutes,exception; uint64_t numerator,denominator,interest = 0; uint32_t activation;
|
||||||
|
activation = 1490531630; // 1491350400 5th April
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
return(0);
|
return(0);
|
||||||
if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN )
|
if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN )
|
||||||
@@ -106,7 +107,9 @@ 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 < 250000 )
|
||||||
|
interest = (numerator / denominator);
|
||||||
|
else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -116,20 +119,19 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 )
|
/* 250000 algo
|
||||||
{
|
|
||||||
numerator = (nValue * KOMODO_INTEREST);
|
numerator = (nValue * KOMODO_INTEREST);
|
||||||
if ( txheight >= 250000 )
|
if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 )
|
||||||
printf("numerator * minutes < 365 * 24 * 60\n");
|
interest = (numerator / denominator) / COIN;
|
||||||
|
else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
|
||||||
|
*/
|
||||||
|
numerator = (nValue * KOMODO_INTEREST);
|
||||||
|
if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 )
|
||||||
interest = (numerator / denominator) / COIN;
|
interest = (numerator / denominator) / COIN;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( tiptime < 1490531630 ) // 1491350400 5th April
|
if ( tiptime < activation )
|
||||||
{
|
|
||||||
numerator = (nValue * KOMODO_INTEREST);
|
|
||||||
interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
|
interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
numerator = (nValue / 20); // assumes 5%!
|
numerator = (nValue / 20); // assumes 5%!
|
||||||
|
|||||||
Reference in New Issue
Block a user