From 38dfbe150a6b0e24dc5c5c01fe390c2d404b45f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Nov 2016 17:57:55 -0300 Subject: [PATCH] test --- src/coins.cpp | 2 +- src/main.cpp | 4 ++-- src/wallet/wallet.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index 7a17534d1..7c3555f13 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -400,7 +400,7 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr #ifdef KOMODO_ENABLE_INTEREST if ( value >= COIN ) { - if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& nHeight >= 60000 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 ) { int64_t interest; int32_t txheight; uint32_t locktime; interest = komodo_accrued_interest(&txheight,&locktime,tx.vin[i].prevout.hash,tx.vin[i].prevout.n,0,value); diff --git a/src/main.cpp b/src/main.cpp index 5d97e7d05..c34044672 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1719,7 +1719,7 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c // Check for negative or overflow input values nValueIn += coins->vout[prevout.n].nValue; #ifdef KOMODO_ENABLE_INTEREST - if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& nHeight >= 60000 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 ) { if ( coins->vout[prevout.n].nValue >= COIN ) { @@ -1757,7 +1757,7 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c if (!MoneyRange(nFees)) return state.DoS(100, error("CheckInputs(): nFees out of range"), REJECT_INVALID, "bad-txns-fee-outofrange"); -fprintf(stderr,"nFees %.8f\n",(double)nFees/COIN); +//fprintf(stderr,"nFees %.8f\n",(double)nFees/COIN); // The first loop above does all the inexpensive checks. // Only if ALL inputs pass do we perform expensive ECDSA signature checks. // Helps prevent CPU exhaustion attacks. diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a6d5f46c1..80c2581dc 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2208,7 +2208,7 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const { #ifdef KOMODO_ENABLE_INTEREST extern char ASSETCHAINS_SYMBOL[16]; - if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 && chainActive.Tip() != 0 ) + if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 && chainActive.Tip() != 0 ) { if ( pcoin->vout[i].nValue >= COIN ) { @@ -2458,7 +2458,7 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set= nTargetValue); } -fprintf(stderr,"nValueRet %8f vs target %.8f\n",(double)nValueRet/COIN,(double)nTargetValue/COIN); +//fprintf(stderr,"nValueRet %8f vs target %.8f\n",(double)nValueRet/COIN,(double)nTargetValue/COIN); return (SelectCoinsMinConf(nTargetValue, 1, 6, vCoins, setCoinsRet, nValueRet,interestp) || SelectCoinsMinConf(nTargetValue, 1, 1, vCoins, setCoinsRet, nValueRet,interestp) || (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet,interestp))); @@ -2591,16 +2591,16 @@ bool CWallet::CreateTransaction(const vector& vecSend, //reflecting an assumption the user would accept a bit more delay for //a chance at a free transaction. //But mempool inputs might still be in the mempool, so their age stays 0 - fprintf(stderr,"nCredit %.8f interest %.8f\n",(double)nCredit/COIN,(double)pcoin.first->vout[pcoin.second].interest/COIN); + //fprintf(stderr,"nCredit %.8f interest %.8f\n",(double)nCredit/COIN,(double)pcoin.first->vout[pcoin.second].interest/COIN); interest2 += pcoin.first->vout[pcoin.second].interest; int age = pcoin.first->GetDepthInMainChain(); if (age != 0) age += 1; dPriority += (double)nCredit * age; } - fprintf(stderr,"interest sum %.8f, interest2 %.8f\n",(double)interest/COIN,(double)interest2/COIN); + //fprintf(stderr,"interest sum %.8f, interest2 %.8f\n",(double)interest/COIN,(double)interest2/COIN); CAmount nChange = (nValueIn - nValue + interest); -fprintf(stderr,"wallet change %.8f (%.8f - %.8f) interest %.8f total %.8f\n",(double)nChange/COIN,(double)nValueIn/COIN,(double)nValue/COIN,(double)interest/COIN,(double)nTotalValue/COIN); +//fprintf(stderr,"wallet change %.8f (%.8f - %.8f) interest %.8f total %.8f\n",(double)nChange/COIN,(double)nValueIn/COIN,(double)nValue/COIN,(double)interest/COIN,(double)nTotalValue/COIN); if (nSubtractFeeFromAmount == 0) nChange -= nFeeRet;