test
This commit is contained in:
@@ -384,6 +384,7 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const
|
||||
}
|
||||
|
||||
uint32_t komodo_txtime(uint256 hash);
|
||||
int64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
|
||||
|
||||
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx,uint32_t tiptime) const
|
||||
{
|
||||
|
||||
@@ -271,13 +271,16 @@ uint32_t komodo_txtime(uint256 hash)
|
||||
|
||||
int64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
|
||||
{
|
||||
int32_t minutes;
|
||||
int32_t minutes,days; uint64_t interest = 0;
|
||||
if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= COIN )
|
||||
{
|
||||
minutes = (tiptime - nLockTime) / 60;
|
||||
fprintf(stderr,"komodo_interest %lld nLockTime.%u tiptime.%u minutes.%d\n",(long long)nValue,nLockTime,tiptime,minutes);
|
||||
days = minutes / (24 * 60);
|
||||
if ( days > 0 )
|
||||
interest = (nValue * 50000) / (365 * 1000000 / days);
|
||||
fprintf(stderr,"komodo_interest %lld nLockTime.%u tiptime.%u minutes.%d days.%d interest %lld %.4f%%\n",(long long)nValue,nLockTime,tiptime,minutes,days,(long long)interest,(double)interest/10000.);
|
||||
}
|
||||
return(0);
|
||||
return(interest * 0);
|
||||
}
|
||||
|
||||
void komodo_nutxoadd(int32_t addflag,int32_t height,int32_t notaryid,uint256 txhash,uint64_t voutmask,int32_t numvouts)
|
||||
|
||||
@@ -2333,6 +2333,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t komodo_interest(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
|
||||
bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet, bool& fOnlyCoinbaseCoinsRet, bool& fNeedCoinbaseCoinsRet, const CCoinControl* coinControl) const
|
||||
{
|
||||
// Output parameter fOnlyCoinbaseCoinsRet is set to true when the only available coins are coinbase utxos.
|
||||
@@ -2374,6 +2375,7 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
|
||||
if(!out.fSpendable)
|
||||
continue;
|
||||
nValueRet += out.tx->vout[out.i].nValue;
|
||||
nValueRet += komodo_interest(out.tx->vout[out.i].nValue,out.tx.nLockTime,activeChain.Tip()->nTime);
|
||||
setCoinsRet.insert(make_pair(out.tx, out.i));
|
||||
}
|
||||
return (nValueRet >= nTargetValue);
|
||||
|
||||
Reference in New Issue
Block a user