From 533356ce63832928b97c6c234c47daabc0624eba Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 6 Apr 2023 13:22:20 -0400 Subject: [PATCH] Remove more dead code related to interest --- src/wallet/wallet.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e19152f38..96d01260d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3773,26 +3773,12 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt //a chance at a free transaction. //But mempool inputs might still be in the mempool, so their age stays 0 //fprintf(stderr,"nCredit %.8f interest %.8f\n",(double)nCredit/COIN,(double)pcoin.first->vout[pcoin.second].interest/COIN); - if ( SMART_CHAIN_SYMBOL[0] == 0 ) - { - interest2 += pcoin.first->vout[pcoin.second].interest; - //fprintf(stderr,"%.8f ",(double)pcoin.first->vout[pcoin.second].interest/COIN); - } int age = pcoin.first->GetDepthInMainChain(); if (age != 0) 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; - CTxOut newTxOut(interest2,scriptDonation); - int32_t nDonationPosRet = txNew.vout.size() - 1; // dont change first or last - vector::iterator position = txNew.vout.begin()+nDonationPosRet; - txNew.vout.insert(position, newTxOut); - interest2 = 0; - } + CAmount nChange = (nValueIn - nValue + interest2); //fprintf(stderr,"wallet change %.8f (%.8f - %.8f) interest2 %.8f total %.8f\n",(double)nChange/COIN,(double)nValueIn/COIN,(double)nValue/COIN,(double)interest2/COIN,(double)nTotalValue/COIN); if (nSubtractFeeFromAmount == 0)