diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -546,7 +546,7 @@ } // Fee - nPayFee = GetMinimumFee(nBytes, nTxConfirmTarget, g_mempool); + nPayFee = GetMinimumFee(nBytes, g_mempool); if (nPayAmount > Amount::zero()) { nChange = nAmount - nPayAmount; @@ -636,7 +636,7 @@ "than the current dust threshold."); // how many satoshis the estimated fee can vary per byte we guess wrong - double dFeeVary = GetMinimumFee(1000, 2, g_mempool) / (1000 * SATOSHI); + double dFeeVary = GetMinimumFee(1000, g_mempool) / (1000 * SATOSHI); QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary); diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -213,7 +213,7 @@ connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); - ui->customFee->setSingleStep(GetMinimumFee(1000, 2, g_mempool)); + ui->customFee->setSingleStep(GetMinimumFee(1000, g_mempool)); updateFeeSectionControls(); updateMinFeeLabel(); updateSmartFeeLabel(); @@ -669,7 +669,7 @@ void SendCoinsDialog::setMinimumFee() { ui->radioCustomPerKilobyte->setChecked(true); - ui->customFee->setValue(GetMinimumFee(1000, 2, g_mempool)); + ui->customFee->setValue(GetMinimumFee(1000, g_mempool)); } void SendCoinsDialog::updateFeeSectionControls() { @@ -715,7 +715,7 @@ tr("Pay only the required fee of %1") .arg(BitcoinUnits::formatWithUnit( model->getOptionsModel()->getDisplayUnit(), - GetMinimumFee(1000, 2, g_mempool)) + + GetMinimumFee(1000, g_mempool)) + "/kB")); } } @@ -732,7 +732,7 @@ BitcoinUnits::formatWithUnit( model->getOptionsModel()->getDisplayUnit(), std::max(CWallet::fallbackFee.GetFeePerK(), - GetMinimumFee(1000, 2, g_mempool))) + + GetMinimumFee(1000, g_mempool))) + "/kB"); // (Smart fee not initialized yet. This usually takes a few blocks...) ui->labelSmartFee2->show(); @@ -742,7 +742,7 @@ BitcoinUnits::formatWithUnit( model->getOptionsModel()->getDisplayUnit(), std::max(feeRate.GetFeePerK(), - GetMinimumFee(1000, 2, g_mempool))) + + GetMinimumFee(1000, g_mempool))) + "/kB"); ui->labelSmartFee2->hide(); ui->labelFeeEstimation->setText( diff --git a/src/wallet/fees.h b/src/wallet/fees.h --- a/src/wallet/fees.h +++ b/src/wallet/fees.h @@ -9,8 +9,6 @@ #include "amount.h" -class CCoinControl; -class CFeeRate; class CTxMemPool; struct FeeCalculation; @@ -18,15 +16,12 @@ * Estimate the minimum fee considering user set parameters * and the required fee */ -Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, - const CTxMemPool &pool); +Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool); /** - * Estimate the minimum fee considering required fee and targetFee or if 0 - * then fee estimation for nConfirmTarget + * Estimate the minimum fee considering required fee and targetFee */ - -Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, - const CTxMemPool &pool, Amount targetFee); +Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, + Amount targetFee); #endif // BITCOIN_WALLET_FEES_H diff --git a/src/wallet/fees.cpp b/src/wallet/fees.cpp --- a/src/wallet/fees.cpp +++ b/src/wallet/fees.cpp @@ -10,11 +10,10 @@ #include "txmempool.h" #include "util.h" #include "validation.h" -#include "wallet/coincontrol.h" #include "wallet/wallet.h" -Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, - const CTxMemPool &pool, Amount targetFee) { +Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, + Amount targetFee) { Amount nFeeNeeded = targetFee; // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == Amount::zero()) { @@ -38,9 +37,7 @@ return nFeeNeeded; } -Amount GetMinimumFee(unsigned int nTxBytes, unsigned int nConfirmTarget, - const CTxMemPool &pool) { +Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool) { // payTxFee is the user-set global for desired feerate. - return GetMinimumFee(nTxBytes, nConfirmTarget, pool, - payTxFee.GetFeeCeiling(nTxBytes)); + return GetMinimumFee(nTxBytes, pool, payTxFee.GetFeeCeiling(nTxBytes)); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3065,15 +3065,7 @@ vin.scriptSig = CScript(); } - // Allow to override the default confirmation target over the - // CoinControl instance. - int currentConfirmationTarget = nTxConfirmTarget; - if (coinControl && coinControl->nConfirmTarget > 0) { - currentConfirmationTarget = coinControl->nConfirmTarget; - } - - Amount nFeeNeeded = - GetMinimumFee(nBytes, currentConfirmationTarget, g_mempool); + Amount nFeeNeeded = GetMinimumFee(nBytes, g_mempool); if (coinControl && coinControl->fOverrideFeeRate) { nFeeNeeded = coinControl->nFeeRate.GetFeeCeiling(nBytes); } @@ -3103,8 +3095,7 @@ // tx size) and so we should add a change output. Only try this // once. Amount fee_needed_for_change = - GetMinimumFee(change_prototype_size, - currentConfirmationTarget, g_mempool); + GetMinimumFee(change_prototype_size, g_mempool); Amount minimum_value_for_change = change_prototype_txout.GetDustThreshold(dustRelayFee); Amount max_excess_fee =