From fd8dd3c26d8c009430b057c2568268f88420463c Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 4 Nov 2016 18:11:04 -0300 Subject: [PATCH] test --- src/coins.cpp | 3 ++- src/komodo_gateway.h | 5 ++++- src/wallet/wallet.cpp | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index a3acfd559..bbff5495b 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -384,6 +384,7 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const } uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); +extern char ASSETCHAINS_SYMBOL[16]; CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTransaction& tx,uint32_t tiptime) const { @@ -398,7 +399,7 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr nResult += value; interest = komodo_interest(nHeight,value,tx.nLockTime,tiptime); #ifdef KOMODO_ENABLE_INTEREST - if ( nHeight >= 60000 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 ) nResult += interest; #endif (*interestp) += interest; diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 779fe5452..6533f73cb 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -243,8 +243,11 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3 komodo_gateway_deposit(coinaddr,value,shortflag,base,fiatoshis,rmd160,txid,vout,height); } } - else + else if ( tokomodo != 0 && ASSETCHAINS_SYMBOL[0] == 0 ) { + for (i=0; i return all selected outputs (we want all selected to go into the transaction for sure) if (coinControl && coinControl->HasSelected()) { + extern char ASSETCHAINS_SYMBOL[16]; uint64_t interest; BOOST_FOREACH(const COutput& out, vCoins) { @@ -2400,7 +2401,7 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, setvout[out.i].nValue; interest = komodo_interest(chainActive.Tip()->nHeight,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime); #ifdef KOMODO_ENABLE_INTEREST - if ( txheight >= 60000 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && txheight >= 60000 ) nValueRet += interest; #endif fprintf(stderr,"interest %llu from %llu lock.%u tip.%u\n",(long long)interest,(long long)out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);