From 17914f3e595be633e8d1680dc289db9c9db5b812 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Mar 2017 19:15:56 +0300 Subject: [PATCH 1/3] Test --- src/komodo_events.h | 5 ++++- src/komodo_interest.h | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/komodo_events.h b/src/komodo_events.h index 2652aaa58..110c1f757 100644 --- a/src/komodo_events.h +++ b/src/komodo_events.h @@ -40,7 +40,10 @@ void komodo_eventadd_notarized(struct komodo_state *sp,char *symbol,int32_t heig { struct komodo_event_notarized N; if ( komodo_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid) != 0 ) - printf("[%s] error validating notarization ht.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + { + if ( height > 50000 ) + printf("[%s] error validating notarization ht.%d notarized_height.%d\n",ASSETCHAINS_SYMBOL,height,notarizedheight); + } else { memset(&N,0,sizeof(N)); diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 8fb1cb5ac..00c4e95eb 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -136,11 +136,11 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { numerator = (nValue / 20); // assumes 5%! interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); - //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); + fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); } - if ( 0 && numerator == (nValue * KOMODO_INTEREST) ) - fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes)); } + if ( 1 && numerator == (nValue * KOMODO_INTEREST) ) + fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes)); } } return(interest); From fb3715334a9f90be1b2d5557260165cb235e0422 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Mar 2017 19:25:18 +0300 Subject: [PATCH 2/3] Test --- src/komodo_interest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 00c4e95eb..0b4561320 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -126,7 +126,7 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin else interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)) / COIN; */ numerator = (nValue * KOMODO_INTEREST); - if ( txheight < 250000 && tiptime < activation ) + if ( txheight < 250000 || tiptime < activation ) { if ( txheight < 250000 || numerator * minutes < 365 * 24 * 60 ) interest = (numerator / denominator) / COIN; From 71ac621458171a6917d6d3abc33c51ce6a97f8da Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 26 Mar 2017 19:34:55 +0300 Subject: [PATCH 3/3] Test --- src/komodo_interest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index 0b4561320..6355173d8 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -136,10 +136,10 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin { numerator = (nValue / 20); // assumes 5%! interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60)); - fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); + //fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes); } } - if ( 1 && numerator == (nValue * KOMODO_INTEREST) ) + if ( 0 && numerator == (nValue * KOMODO_INTEREST) ) fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes)); } }