test
This commit is contained in:
@@ -384,6 +384,7 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const
|
||||
}
|
||||
|
||||
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
|
||||
extern char ASSETCHAINS_SYMBOL[16];
|
||||
|
||||
CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTransaction& tx,uint32_t tiptime) const
|
||||
{
|
||||
@@ -398,7 +399,7 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
|
||||
nResult += value;
|
||||
interest = komodo_interest(nHeight,value,tx.nLockTime,tiptime);
|
||||
#ifdef KOMODO_ENABLE_INTEREST
|
||||
if ( nHeight >= 60000 )
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 && nHeight >= 60000 )
|
||||
nResult += interest;
|
||||
#endif
|
||||
(*interestp) += interest;
|
||||
|
||||
@@ -243,8 +243,11 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
||||
komodo_gateway_deposit(coinaddr,value,shortflag,base,fiatoshis,rmd160,txid,vout,height);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( tokomodo != 0 && ASSETCHAINS_SYMBOL[0] == 0 )
|
||||
{
|
||||
for (i=0; i<opretlen; i++)
|
||||
printf("%02x",opretbuf[i]);
|
||||
printf(" opret[%c] tokomodo.%d value %.8f vs check %.8f\n",opretbuf[0],tokomodo,dstr(value),dstr(checktoshis));
|
||||
if ( value <= checktoshis )
|
||||
{
|
||||
|
||||
|
||||
@@ -2392,6 +2392,7 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
|
||||
// coin control -> return all selected outputs (we want all selected to go into the transaction for sure)
|
||||
if (coinControl && coinControl->HasSelected())
|
||||
{
|
||||
extern char ASSETCHAINS_SYMBOL[16];
|
||||
uint64_t interest;
|
||||
BOOST_FOREACH(const COutput& out, vCoins)
|
||||
{
|
||||
@@ -2400,7 +2401,7 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
|
||||
nValueRet += out.tx->vout[out.i].nValue;
|
||||
interest = komodo_interest(chainActive.Tip()->nHeight,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);
|
||||
#ifdef KOMODO_ENABLE_INTEREST
|
||||
if ( txheight >= 60000 )
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 && txheight >= 60000 )
|
||||
nValueRet += interest;
|
||||
#endif
|
||||
fprintf(stderr,"interest %llu from %llu lock.%u tip.%u\n",(long long)interest,(long long)out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);
|
||||
|
||||
Reference in New Issue
Block a user