From 258748f59160422bee0f05a0cc5121f267050216 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Nov 2016 17:10:24 -0300 Subject: [PATCH] test --- src/wallet/wallet.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9a9fc7594..d186fce72 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2213,17 +2213,32 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const if ( pcoin->vout[i].nValue >= COIN ) { interest = komodo_interest(chainActive.Tip()->nHeight+1,pcoin->vout[i].nValue,pcoin->nLockTime,chainActive.Tip()->nTime); - if ( interest != 0 && pcoin->vout[i].interest == 0 ) + if ( interest != 0 ) { //printf("wallet nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)pcoin->vout[i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,pcoin->nLockTime,chainActive.Tip()->nTime); - //fprintf(stderr,"wallet nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)pcoin->vout[i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,pcoin->nLockTime,chainActive.Tip()->nTime); + fprintf(stderr,"wallet nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)pcoin->vout[i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,pcoin->nLockTime,chainActive.Tip()->nTime); ptr = (uint64_t *)&pcoin->vout[i].nValue; (*ptr) += interest; ptr = (uint64_t *)&pcoin->vout[i].interest; (*ptr) = interest; //pcoin->vout[i].nValue += interest; } + else + { + ptr = (uint64_t *)&pcoin->vout[i].interest; + (*ptr) = 0; + } } + else + { + ptr = (uint64_t *)&pcoin->vout[i].interest; + (*ptr) = 0; + } + } + else + { + ptr = (uint64_t *)&pcoin->vout[i].interest; + (*ptr) = 0; } #endif vCoins.push_back(COutput(pcoin, i, nDepth, (mine & ISMINE_SPENDABLE) != ISMINE_NO));