|
|
@ -76,7 +76,6 @@ void EnsureWalletIsUnlocked() |
|
|
|
} |
|
|
|
|
|
|
|
uint64_t komodo_accrued_interest(int32_t *txheightp,uint32_t *locktimep,uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue,int32_t tipheight); |
|
|
|
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); |
|
|
|
|
|
|
|
void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry) |
|
|
|
{ |
|
|
@ -2562,8 +2561,6 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp) |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); |
|
|
|
|
|
|
|
UniValue listunspent(const UniValue& params, bool fHelp) |
|
|
|
{ |
|
|
|
if (!EnsureWalletIsAvailable(fHelp)) |
|
|
@ -2678,8 +2675,8 @@ UniValue listunspent(const UniValue& params, bool fHelp) |
|
|
|
uint64_t interest; uint32_t locktime; int32_t txheight; |
|
|
|
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 ) |
|
|
|
{ |
|
|
|
komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight); |
|
|
|
interest = komodo_interest(txheight,nValue,out.tx->nLockTime,tipindex->nTime); |
|
|
|
interest = komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight); |
|
|
|
//interest = komodo_interest(txheight,nValue,out.tx->nLockTime,tipindex->nTime);
|
|
|
|
entry.push_back(Pair("interest",ValueFromAmount(interest))); |
|
|
|
} |
|
|
|
//fprintf(stderr,"nValue %.8f pindex.%p tipindex.%p locktime.%u txheight.%d pindexht.%d\n",(double)nValue/COIN,pindex,chainActive.Tip(),locktime,txheight,pindex->nHeight);
|
|
|
@ -2708,7 +2705,8 @@ uint64_t komodo_interestsum() |
|
|
|
CBlockIndex *tipindex,*pindex = it->second; |
|
|
|
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 ) |
|
|
|
{ |
|
|
|
interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,tipindex->nTime); |
|
|
|
interest = komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight); |
|
|
|
//interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,tipindex->nTime);
|
|
|
|
sum += interest; |
|
|
|
} |
|
|
|
} |
|
|
|