From 4fbe32490799b2d5fcc3a5cc3855a69baa1a4da3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Jan 2017 02:48:33 +0200 Subject: [PATCH] test --- src/komodo_interest.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index f7cd6545f..0f0a9ceb2 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -72,13 +72,19 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { 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); - if ( txheight < 150000 ) - interest /= COIN; + if ( nValue > 25000*COIN ) + { + numerator = (nValue * (KOMODO_INTEREST / COIN)); + interest = (numerator / denominator); + } + 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); } }