This commit is contained in:
jl777
2016-10-21 18:14:17 -03:00
parent 5c2c4d0edc
commit ce8b023c7a
2 changed files with 3 additions and 1 deletions

View File

@@ -272,6 +272,8 @@ uint32_t komodo_txtime(uint256 hash)
int64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime) int64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
{ {
int32_t minutes,days; uint64_t interest = 0; int32_t minutes,days; uint64_t interest = 0;
if ( tiptime == 0 )
tiptime = activeChain.Tip()->nTime;
if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= COIN ) if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= COIN )
{ {
minutes = (tiptime - nLockTime) / 60; minutes = (tiptime - nLockTime) / 60;

View File

@@ -2364,7 +2364,7 @@ Value listunspent(const Array& params, bool fHelp)
} }
} }
entry.push_back(Pair("amount",ValueFromAmount(nValue))); entry.push_back(Pair("amount",ValueFromAmount(nValue)));
entry.push_back(Pair("interest",ValueFromAmount(komodo_interest(nValue,out.tx->nLockTime,activeChain.Tip()->nTime)))); entry.push_back(Pair("interest",ValueFromAmount(komodo_interest(nValue,out.tx->nLockTime,0))));
entry.push_back(Pair("confirmations",out.nDepth)); entry.push_back(Pair("confirmations",out.nDepth));
entry.push_back(Pair("spendable", out.fSpendable)); entry.push_back(Pair("spendable", out.fSpendable));
results.push_back(entry); results.push_back(entry);