This commit is contained in:
jl777
2016-11-15 10:38:38 -03:00
parent a130c5cb66
commit 0fec0cc4b3
6 changed files with 44 additions and 35 deletions

View File

@@ -2473,11 +2473,11 @@ Value listunspent(const Array& params, bool fHelp)
if ( out.tx->nLockTime != 0 )
{
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex *pindex = it->second;
CBlockIndex *tipindex,*pindex = it->second;
uint64_t interest;
if ( pindex != 0 )
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 )
{
interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,pindex->nTime);
interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,tipindex->nTime);
entry.push_back(Pair("interest",ValueFromAmount(interest)));
}
}

View File

@@ -2399,11 +2399,11 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
if(!out.fSpendable)
continue;
nValueRet += out.tx->vout[out.i].nValue;
interest = komodo_interest(chainActive.Tip()->nHeight+1,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);
#ifdef KOMODO_ENABLE_INTEREST
if ( ASSETCHAINS_SYMBOL[0] == 0 && chainActive.Tip()->nHeight+1 >= 60000 )
if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& chainActive.Tip()->nHeight+1 >= 60000 )
{
//if ( interest != 0 )
interest = komodo_interest(chainActive.Tip()->nHeight+1,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);
if ( interest != 0 || value >= COIN*100 )
{
printf("nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)out.tx->vout[out.i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);
fprintf(stderr,"nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)nValueRet/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);