diff --git a/src/komodo_interest.h b/src/komodo_interest.h index e78c65fc5..f86d29267 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -48,13 +48,15 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin int32_t minutes; uint64_t numerator,denominator,interest = 0; if ( komodo_moneysupply(txheight) < MAX_MONEY && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= COIN ) { - minutes = (tiptime - nLockTime) / 60; - 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) / COIN; - 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); + if ( (minutes= (tiptime - nLockTime) / 60) > 60 ) + { + 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) / COIN; + 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); }