From 0cccde9df7e6f4c117ded62db73472b709edbca7 Mon Sep 17 00:00:00 2001 From: Pasta Date: Tue, 3 Sep 2019 18:06:10 -0500 Subject: [PATCH] fix all of the problems Signed-off-by: Pasta --- src/privatesend/privatesend-client.cpp | 6 +++--- src/qt/coincontroldialog.h | 2 +- src/rpc/rpcevo.cpp | 2 +- src/wallet/rpcwallet.cpp | 4 ++-- src/wallet/wallet.cpp | 4 ++-- src/wallet/wallet.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/privatesend/privatesend-client.cpp b/src/privatesend/privatesend-client.cpp index 0ca54b0084..a79cc214f5 100644 --- a/src/privatesend/privatesend-client.cpp +++ b/src/privatesend/privatesend-client.cpp @@ -1447,14 +1447,14 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(const CompactTallyItem& ta } bool fSuccess = vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, - nFeeRet, nChangePosRet, strFail, &coinControl, true, ONLY_NONDENOMINATED); + nFeeRet, nChangePosRet, strFail, coinControl, true, ONLY_NONDENOMINATED); if (!fSuccess) { LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- ONLY_NONDENOMINATED: %s\n", strFail); // If we failed then most likely there are not enough funds on this address. if (fTryDenominated) { // Try to also use denominated coins (we can't mix denominated without collaterals anyway). if (!vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, - nFeeRet, nChangePosRet, strFail, &coinControl, true, ALL_COINS)) { + nFeeRet, nChangePosRet, strFail, coinControl, true, ALL_COINS)) { LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- ALL_COINS Error: %s\n", strFail); reservekeyCollateral.ReturnKey(); return false; @@ -1615,7 +1615,7 @@ bool CPrivateSendClientSession::CreateDenominated(CAmount nBalanceToDenominate, CReserveKey reservekeyChange(vpwallets[0]); bool fSuccess = vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, - nFeeRet, nChangePosRet, strFail, &coinControl, true, ONLY_NONDENOMINATED); + nFeeRet, nChangePosRet, strFail, coinControl, true, ONLY_NONDENOMINATED, 0); if (!fSuccess) { LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::CreateDenominated -- Error: %s\n", strFail); keyHolderStorageDenom.ReturnAll(); diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 2940ab3bd2..c50b16ca2c 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -52,7 +52,7 @@ public: static void updateLabels(WalletModel*, QDialog*); static QList payAmounts; - static CCoinControl *coinControl; + static CCoinControl* coinControl; static bool fSubtractFeeFromAmount; private: diff --git a/src/rpc/rpcevo.cpp b/src/rpc/rpcevo.cpp index c2d4e5c985..9c95d932ad 100644 --- a/src/rpc/rpcevo.cpp +++ b/src/rpc/rpcevo.cpp @@ -212,7 +212,7 @@ static void FundSpecialTx(CWallet* pwallet, CMutableTransaction& tx, const Speci int nChangePos = -1; std::string strFailReason; - if (!pwallet->CreateTransaction(vecSend, wtx, reservekey, nFee, nChangePos, strFailReason, &coinControl, false, ALL_COINS, tx.vExtraPayload.size())) { + if (!pwallet->CreateTransaction(vecSend, wtx, reservekey, nFee, nChangePos, strFailReason, coinControl, false, ALL_COINS, tx.vExtraPayload.size())) { throw JSONRPCError(RPC_INTERNAL_ERROR, strFailReason); } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index a483372e7c..997271bcbc 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -375,7 +375,7 @@ UniValue getaddressesbyaccount(const JSONRPCRequest& request) return ret; } -static void SendMoney(CWallet * const pwallet, const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, CWalletTx& wtxNew, bool fUsePrivateSend = false, const CCoinControl& coin_control) +static void SendMoney(CWallet * const pwallet, const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, CWalletTx& wtxNew, const CCoinControl& coin_control, bool fUsePrivateSend = false) { CAmount curBalance = pwallet->GetBalance(); @@ -494,7 +494,7 @@ UniValue sendtoaddress(const JSONRPCRequest& request) EnsureWalletIsUnlocked(pwallet); - SendMoney(pwallet, address.Get(), nAmount, fSubtractFeeFromAmount, wtx, fUsePrivateSend, coin_control); + SendMoney(pwallet, address.Get(), nAmount, fSubtractFeeFromAmount, wtx, coin_control, fUsePrivateSend); return wtx.GetHash().GetHex(); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c0072b9d2d..9b95b641b1 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3510,7 +3510,7 @@ bool CWallet::GetBudgetSystemCollateralTX(CWalletTx& tx, uint256 hash, CAmount a if (!outpoint.IsNull()) { coinControl.Select(outpoint); } - bool success = CreateTransaction(vecSend, tx, reservekey, nFeeRet, nChangePosRet, strFail, &coinControl, true, ALL_COINS); + bool success = CreateTransaction(vecSend, tx, reservekey, nFeeRet, nChangePosRet, strFail, coinControl, true, ALL_COINS); if(!success){ LogPrintf("CWallet::GetBudgetSystemCollateralTX -- Error: %s\n", strFail); return false; @@ -3605,7 +3605,7 @@ bool CWallet::CreateTransaction(const std::vector& vecSend, CWalletT LOCK2(cs_main, cs_wallet); { std::vector vAvailableCoins; - AvailableCoins(vAvailableCoins, true, &coinControl, 1, MAX_MONEY, MAX_MONEY, 0, 0, 9999999, nCoinType); + AvailableCoins(vAvailableCoins, true, &coin_control, 1, MAX_MONEY, MAX_MONEY, 0, 0, 9999999, nCoinType); // Create change script that will be used if we need change // TODO: pass in scriptChange instead of reservekey so diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 38f6965647..4a16218af9 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1076,7 +1076,7 @@ public: * Estimate the minimum fee considering user set parameters * and the required fee */ - static CAmount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc); + static CAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc); /** * Return the minimum required fee taking into account the * floating relay fee and user set minimum transaction fee