This commit is contained in:
jl777
2016-10-22 11:56:19 -03:00
parent 24eefea8e0
commit fdbf481faf
5 changed files with 17 additions and 7 deletions

View File

@@ -2364,12 +2364,17 @@ Value listunspent(const Array& params, bool fHelp)
}
}
entry.push_back(Pair("amount",ValueFromAmount(nValue)));
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex *pindex = it->second;
if ( pindex != 0 )
if ( out.tx->nLockTime != 0 )
{
fprintf(stderr,"nLock.%u tip.%u %u\n",out.tx->nLockTime,chainActive.Tip()->nTime,pindex->nTime);
entry.push_back(Pair("interest",ValueFromAmount(komodo_interest(nValue,out.tx->nLockTime,pindex->nTime))));
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex *pindex = it->second;
uint64_t interest;
if ( pindex != 0 )
{
interest = komodo_interest(nValue,out.tx->nLockTime,pindex->nTime);
fprintf(stderr,"nLock.%u tip.%u %u interest.%llu\n",out.tx->nLockTime,chainActive.Tip()->nTime,pindex->nTime,(long long)interest);
entry.push_back(Pair("interest",ValueFromAmount(interest)));
}
}
entry.push_back(Pair("confirmations",out.nDepth));
entry.push_back(Pair("spendable", out.fSpendable));