fix all of the problems

Signed-off-by: Pasta <pasta@dashboost.org>
This commit is contained in:
Pasta 2019-09-03 18:06:10 -05:00
parent 791c07fb06
commit 0cccde9df7
6 changed files with 10 additions and 10 deletions

View File

@ -1447,14 +1447,14 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(const CompactTallyItem& ta
} }
bool fSuccess = vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, bool fSuccess = vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange,
nFeeRet, nChangePosRet, strFail, &coinControl, true, ONLY_NONDENOMINATED); nFeeRet, nChangePosRet, strFail, coinControl, true, ONLY_NONDENOMINATED);
if (!fSuccess) { if (!fSuccess) {
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- ONLY_NONDENOMINATED: %s\n", strFail); 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 we failed then most likely there are not enough funds on this address.
if (fTryDenominated) { if (fTryDenominated) {
// Try to also use denominated coins (we can't mix denominated without collaterals anyway). // Try to also use denominated coins (we can't mix denominated without collaterals anyway).
if (!vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, 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); LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- ALL_COINS Error: %s\n", strFail);
reservekeyCollateral.ReturnKey(); reservekeyCollateral.ReturnKey();
return false; return false;
@ -1615,7 +1615,7 @@ bool CPrivateSendClientSession::CreateDenominated(CAmount nBalanceToDenominate,
CReserveKey reservekeyChange(vpwallets[0]); CReserveKey reservekeyChange(vpwallets[0]);
bool fSuccess = vpwallets[0]->CreateTransaction(vecSend, wtx, reservekeyChange, 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) { if (!fSuccess) {
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::CreateDenominated -- Error: %s\n", strFail); LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::CreateDenominated -- Error: %s\n", strFail);
keyHolderStorageDenom.ReturnAll(); keyHolderStorageDenom.ReturnAll();

View File

@ -52,7 +52,7 @@ public:
static void updateLabels(WalletModel*, QDialog*); static void updateLabels(WalletModel*, QDialog*);
static QList<CAmount> payAmounts; static QList<CAmount> payAmounts;
static CCoinControl *coinControl; static CCoinControl* coinControl;
static bool fSubtractFeeFromAmount; static bool fSubtractFeeFromAmount;
private: private:

View File

@ -212,7 +212,7 @@ static void FundSpecialTx(CWallet* pwallet, CMutableTransaction& tx, const Speci
int nChangePos = -1; int nChangePos = -1;
std::string strFailReason; 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); throw JSONRPCError(RPC_INTERNAL_ERROR, strFailReason);
} }

View File

@ -375,7 +375,7 @@ UniValue getaddressesbyaccount(const JSONRPCRequest& request)
return ret; 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(); CAmount curBalance = pwallet->GetBalance();
@ -494,7 +494,7 @@ UniValue sendtoaddress(const JSONRPCRequest& request)
EnsureWalletIsUnlocked(pwallet); 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(); return wtx.GetHash().GetHex();
} }

View File

@ -3510,7 +3510,7 @@ bool CWallet::GetBudgetSystemCollateralTX(CWalletTx& tx, uint256 hash, CAmount a
if (!outpoint.IsNull()) { if (!outpoint.IsNull()) {
coinControl.Select(outpoint); 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){ if(!success){
LogPrintf("CWallet::GetBudgetSystemCollateralTX -- Error: %s\n", strFail); LogPrintf("CWallet::GetBudgetSystemCollateralTX -- Error: %s\n", strFail);
return false; return false;
@ -3605,7 +3605,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
LOCK2(cs_main, cs_wallet); LOCK2(cs_main, cs_wallet);
{ {
std::vector<COutput> vAvailableCoins; std::vector<COutput> 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 // Create change script that will be used if we need change
// TODO: pass in scriptChange instead of reservekey so // TODO: pass in scriptChange instead of reservekey so

View File

@ -1076,7 +1076,7 @@ public:
* Estimate the minimum fee considering user set parameters * Estimate the minimum fee considering user set parameters
* and the required fee * 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 * Return the minimum required fee taking into account the
* floating relay fee and user set minimum transaction fee * floating relay fee and user set minimum transaction fee