diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 95e7d15fc..07c20cb2f 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -454,7 +454,11 @@ Value gettxout(const Array& params, bool fHelp) else ret.push_back(Pair("confirmations", pindex->nHeight - coins.nHeight + 1)); ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue))); - uint64_t interest; uint32_t timestamp = komodo_txtime(hash); + CBlockIndex *pblockindex = chainActive[coins.nHeight]; + + uint64_t interest; uint32_t timestamp=0; + if ( pblockindex != 0 ) + timestamp = pblockindex->nTime; interest = komodo_interest(coins.vout[n].nValue,timestamp,pindex->nTime); fprintf(stderr,"nValue %llu lock.%u:%u nTime.%u -> %llu\n",(long long)coins.vout[n].nValue,coins.nLockTime,timestamp,pindex->nTime,(long long)interest); ret.push_back(Pair("interest", ValueFromAmount(interest))); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 0a5d8f579..d95dea463 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2372,7 +2372,6 @@ Value listunspent(const Array& params, bool fHelp) 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))); } }