From 2860f74793f84a8bf4e6d0e75673080f9e0f434e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 22 Oct 2016 13:03:18 -0300 Subject: [PATCH] test --- src/rpcblockchain.cpp | 6 +++++- src/wallet/rpcwallet.cpp | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) 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))); } }