Remove Komodo interest code and various other improvements

This commit is contained in:
Duke Leto
2020-12-15 13:14:54 -05:00
parent 87370e1da8
commit c2eec1f7a7
81 changed files with 322 additions and 2911 deletions

View File

@@ -18,10 +18,8 @@
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
#include "wallet/wallet.h"
#include "asyncrpcqueue.h"
#include "checkpoints.h"
#include "coincontrol.h"
#include "consensus/upgrades.h"
@@ -42,9 +40,7 @@
#include "wallet/asyncrpcoperation_saplingconsolidation.h"
#include "zcash/zip32.h"
#include "cc/CCinclude.h"
#include <assert.h>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
@@ -1814,7 +1810,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
if (::IsMine(*this, prev.vout[txin.prevout.n].scriptPubKey) & filter)
return prev.vout[txin.prevout.n].nValue; // komodo_interest?
return prev.vout[txin.prevout.n].nValue;
}
}
return 0;
@@ -3206,8 +3202,6 @@ CAmount CWallet::GetImmatureWatchOnlyBalance() const
/**
* populate vCoins with vector of available COutputs.
*/
uint64_t komodo_interestnew(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
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);
void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl, bool fIncludeZeroValue, bool fIncludeCoinBase) const
{
@@ -3252,10 +3246,8 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
{
if ( (tipindex= chainActive.LastTip()) != 0 )
{
komodo_accrued_interest(&txheight,&locktime,wtxid,i,0,pcoin->vout[i].nValue,(int32_t)tipindex->GetHeight());
interest = komodo_interestnew(txheight,pcoin->vout[i].nValue,locktime,tipindex->nTime);
interest = 0;
} else interest = 0;
//interest = komodo_interestnew(chainActive.LastTip()->GetHeight()+1,pcoin->vout[i].nValue,pcoin->nLockTime,chainActive.LastTip()->nTime);
if ( interest != 0 )
{
ptr = (uint64_t *)&pcoin->vout[i].interest;
@@ -3434,11 +3426,6 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
{
// Output parameter fOnlyCoinbaseCoinsRet is set to true when the only available coins are coinbase utxos.
uint64_t tmp; int32_t retval;
//if ( interestp == 0 )
//{
// interestp = &tmp;
// *interestp = 0;
//}
vector<COutput> vCoinsNoCoinbase, vCoinsWithCoinbase;
AvailableCoins(vCoinsNoCoinbase, true, coinControl, false, false);
AvailableCoins(vCoinsWithCoinbase, true, coinControl, false, true);
@@ -3724,6 +3711,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
age += 1;
dPriority += (double)nCredit * age;
}
//TODO: delete this
if ( SMART_CHAIN_SYMBOL[0] == 0 && DONATION_PUBKEY.size() == 66 && interest2 > 5000 )
{
CScript scriptDonation = CScript() << ParseHex(DONATION_PUBKEY) << OP_CHECKSIG;