From 6cfebd395ac5992ccc32de3f1b08b43b61f8b11c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 15:44:55 +0300 Subject: [PATCH] Test --- src/komodo_interest.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 82581bb03..930e2675a 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -140,14 +140,21 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin numerator = (nValue / 20); // assumes 5%! if ( txheight < 250000 ) interest = (numerator / denominator); - else interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); + else if ( txheight < 1000000 ) + { + interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60); + interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); + //if ( interest < interestnew || interestnew < 0.9999*interest ) + fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); + } + else interest = _komodo_interestnew(nValue,nLockTime,tiptime); } else if ( txheight < 1000000 ) { numerator = (nValue * KOMODO_INTEREST); interest = (numerator / denominator) / COIN; interestnew = _komodo_interestnew(nValue,nLockTime,tiptime); - //if ( interest < interestnew || interestnew < 0.9999*interest ) + if ( interest < interestnew ) fprintf(stderr,"path0 current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime); } else interest = _komodo_interestnew(nValue,nLockTime,tiptime);