This commit is contained in:
jl777
2016-10-21 16:08:37 -03:00
parent 420af8fda7
commit 63a9f52633
4 changed files with 14 additions and 9 deletions

View File

@@ -406,16 +406,21 @@ uint32_t komodo_txtime(uint256 hash)
return(tx.nLockTime);
}
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx,uint32_t blocktime) const
{
if (tx.IsCoinBase())
uint32_t timestamp,minutes;
if ( tx.IsCoinBase() != 0 )
return 0;
CAmount nResult = 0;
CAmount value,nResult = 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
//fprintf(stderr,"GetValueIn i.%d time.%u\n",i,komodo_txtime(tx.vin[i].prevout.hash));
nResult += GetOutputFor(tx.vin[i]).nValue;
value = GetOutputFor(tx.vin[i]).nValue;
nResult += value;
if ( (timestamp= komodo_txtime(tx.vin[i].prevout.hash)) != 0 && timestamp < blocktime-3600*24*7 && value >= COIN )
{
minutes = (blocktime - timestamp) / 60;
fprintf(stderr,"GetValueIn %lld i.%d time.%u minutes.%d\n",(long long)value,i,timestamp,minutes);
}
}
nResult += tx.GetJoinSplitValueIn();