From 5d2f557e4412ba37581ca5c397d1f3c767ef7483 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 4 Jun 2017 19:39:48 +0300 Subject: [PATCH] Disable mining unclaimed interest --- src/coins.cpp | 5 +++-- src/miner.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index c97ba0790..9ac4358cd 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -391,7 +391,8 @@ extern char ASSETCHAINS_SYMBOL[16]; CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTransaction& tx,uint32_t tiptime) const { - *interestp = 0; + if ( interestp != 0 ) + *interestp = 0; if ( tx.IsCoinBase() != 0 ) return 0; CAmount value,nResult = 0; @@ -400,7 +401,7 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr value = GetOutputFor(tx.vin[i]).nValue; nResult += value; #ifdef KOMODO_ENABLE_INTEREST - if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 ) + if ( interestp != 0 && ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 ) { if ( value >= 10*COIN ) { diff --git a/src/miner.cpp b/src/miner.cpp index 3de85e5cf..8cee2e5d0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -335,7 +335,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (!view.HaveInputs(tx)) continue; - CAmount nTxFees = view.GetValueIn(chainActive.Tip()->nHeight,&interest,tx,chainActive.Tip()->nTime)-tx.GetValueOut(); + CAmount nTxFees = view.GetValueIn(chainActive.Tip()->nHeight,0,tx,chainActive.Tip()->nTime)-tx.GetValueOut(); nTxSigOps += GetP2SHSigOpCount(tx, view); if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS)