From 6da8d0d55eba534924c93919aee3b9ebc390e674 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 10 Oct 2017 14:15:58 +0300 Subject: [PATCH] Test --- src/komodo_interest.h | 6 +++--- src/main.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/komodo_interest.h b/src/komodo_interest.h index a407aabd8..27ab20be4 100644 --- a/src/komodo_interest.h +++ b/src/komodo_interest.h @@ -23,7 +23,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) { static uint64_t *interests; static int32_t maxheight; uint64_t total; int32_t ind,incr = 10000; - // need to make interests persistent before 2030 + // need to make interests persistent before 2030, or just hardfork interest/mining rewards disable after MAX_MONEY is exceeded if ( height >= maxheight ) { if ( interests == 0 ) @@ -45,7 +45,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) } else { - if ( interests[ind + 1] != paidinterest ) + if ( interests[ind + 1] != paidinterest ) // need to handle skips like at 80000 { fprintf(stderr,"interests.%d %.8f %.8f vs paidinterest %.8f\n",height,dstr(interests[ind]),dstr(interests[ind+1]),dstr(paidinterest)); interests[ind + 1] = paidinterest; @@ -68,7 +68,7 @@ uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) uint64_t komodo_moneysupply(int32_t height) { - if ( height <= 1 || ASSETCHAINS_SYMBOL[0] != 0 ) + if ( height <= 1 || ASSETCHAINS_SYMBOL[0] == 0 ) return(0); else return(COIN * 100000000 + (height-1) * 3 + komodo_earned_interest(height,-1)); } diff --git a/src/main.cpp b/src/main.cpp index b354c1430..8f028dbb7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2365,7 +2365,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return false; control.Add(vChecks); } - komodo_earned_interest(pindex->nHeight,sum); + if ( ASSETCHAINS_SYMBOL[0] == 0 ) + komodo_earned_interest(pindex->nHeight,sum); CTxUndo undoDummy; if (i > 0) { blockundo.vtxundo.push_back(CTxUndo());