From d4a420a3126d93d791cc212fd9b9266453a9d9c4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 25 Jan 2017 06:48:36 +0200 Subject: [PATCH] test --- src/komodo_interest.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 0cdab11eb..798dd7e02 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -75,10 +75,23 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin denominator = (((uint64_t)365 * 24 * 60) / minutes); if ( denominator == 0 ) denominator = 1; // max KOMODO_INTEREST per transfer, do it at least annually! - if ( nValue > 25000LL*COIN && txheight > 155949 ) + if ( nValue > 25000LL*COIN ) { - numerator = (nValue / 20); // assumes 5%! - interest = (numerator / denominator); + if ( txheight <= 155949 ) + { + printf(">>>>>>>>>>>> txheight.%d %.8f locktime %u vs tiptime %u <<<<<<<<<\n",txheight,(double)nValue/COIN,nLockTime,tiptime); + exception = 0; + } + if ( exception == 0 ) + { + numerator = (nValue / 20); // assumes 5%! + interest = (numerator / denominator); + } + else + { + numerator = (nValue * KOMODO_INTEREST); + interest = (numerator / denominator) / COIN; + } } else {