test
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#define KOMODO_INTEREST ((uint64_t)0.05 * COIN)
|
||||
#define dstr(x) ((double)(x)/COIN)
|
||||
|
||||
uint64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
||||
{
|
||||
@@ -8,8 +9,12 @@ uint64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
||||
if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= COIN )
|
||||
{
|
||||
minutes = (tiptime - nLockTime) / 60;
|
||||
interest = (nValue * KOMODO_INTEREST) / (((uint64_t)365 * 100000000 * 24 * 60) / minutes);
|
||||
fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f\n",(long long)nValue,(double)nValue/100000000.,nLockTime,tiptime,minutes,(long long)interest,(double)interest/100000000);
|
||||
numerator = (nValue * KOMODO_INTEREST);
|
||||
denominator = (((uint64_t)365 * 24 * 60) / minutes);
|
||||
if ( denominator == 0 )
|
||||
denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually!
|
||||
interest = numerator / denominator;
|
||||
fprintf(stderr,"komodo_interest %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu)\n",(long long)nValue,dstr(nValue),nLockTime,tiptime,minutes,(long long)interest,dstr(interest),(long long)numerator,(long long)denominator);
|
||||
}
|
||||
return(interest * 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user