mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
fix all of the problems
Signed-off-by: Pasta <pasta@dashboost.org>
This commit is contained in:
parent
791c07fb06
commit
0cccde9df7
@ -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();
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
static void updateLabels(WalletModel*, QDialog*);
|
||||
|
||||
static QList<CAmount> payAmounts;
|
||||
static CCoinControl *coinControl;
|
||||
static CCoinControl* coinControl;
|
||||
static bool fSubtractFeeFromAmount;
|
||||
|
||||
private:
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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<CRecipient>& vecSend, CWalletT
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
{
|
||||
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
|
||||
// TODO: pass in scriptChange instead of reservekey so
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user