Merge pull request #299 from jl777/dev

Test
This commit is contained in:
jl777
2017-03-17 18:19:22 +02:00
committed by GitHub

View File

@@ -99,7 +99,6 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
if ( exception == 0 || nValue == 4000000000000LL ) if ( exception == 0 || nValue == 4000000000000LL )
printf(">>>>>>>>>>>> exception.%d txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",exception,txheight,(double)nValue/COIN,nLockTime,tiptime); printf(">>>>>>>>>>>> exception.%d txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",exception,txheight,(double)nValue/COIN,nLockTime,tiptime);
} }
//if ( nValue == 4000000000000LL ) //if ( nValue == 4000000000000LL )
// printf(">>>>>>>>>>>> exception.%d txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",exception,txheight,(double)nValue/COIN,nLockTime,tiptime); // printf(">>>>>>>>>>>> exception.%d txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",exception,txheight,(double)nValue/COIN,nLockTime,tiptime);
if ( exception == 0 ) if ( exception == 0 )
@@ -107,11 +106,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
numerator = (nValue / 20); // assumes 5%! numerator = (nValue / 20); // assumes 5%!
if ( txheight < 30000 ) if ( txheight < 30000 )
interest = (numerator / denominator); interest = (numerator / denominator);
else else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
{
interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
printf("(%llu * %llu) = %llu; ",(long long)numerator,(long long)minutes,(long long)(numerator * minutes));
}
} }
else else
{ {
@@ -126,7 +121,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
interest = (numerator / denominator) / COIN; interest = (numerator / denominator) / COIN;
else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / 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);