From 98d166cfc9682bd92eb832b120604b1e2863a77b Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Nov 2016 11:33:45 -0300 Subject: [PATCH] test --- src/coins.cpp | 8 +++++--- src/rpcmisc.cpp | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/coins.cpp b/src/coins.cpp index d572990b5..ba9bd51e9 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -383,7 +383,8 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const return coins->vout[input.prevout.n].scriptPubKey; } -uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); +//uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); +uint64_t komodo_accrued_interest(uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue); extern char ASSETCHAINS_SYMBOL[16]; CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTransaction& tx,uint32_t tiptime) const @@ -400,8 +401,9 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& nHeight >= 60000 ) { int64_t interest; - interest = komodo_interest(nHeight,value,tx.nLockTime,tiptime); - if ( interest != 0 || value >= COIN*100 ) + interest = komodo_accrued_interest(tx.vin[i].hash,tx.vin[i].n,nHeight,value); + //interest = komodo_interest(nHeight,value,tx.nLockTime,tiptime); + //if ( interest != 0 || value >= COIN*100 ) { printf("nResult %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)nResult/COIN,(double)interest/COIN,nHeight,tx.nLockTime,tiptime); fprintf(stderr,"nResult %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)nResult/COIN,(double)interest/COIN,nHeight,tx.nLockTime,tiptime); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 4642a52db..66e3c54f7 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -94,6 +94,8 @@ Value getinfo(const Array& params, bool fHelp) #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); obj.push_back(Pair("timeoffset", GetTimeOffset())); + if ( chainActive.Tip() != 0 ) + obj.push_back(Pair("tiptime", chainActive.Tip()->nTime)); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty()));