From f0bf33da8357bd6aff100bbe5b84a7f01937e379 Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Tue, 13 Jun 2017 14:02:55 -0400 Subject: Change default fee estimation mode. Fee estimates will default to be non-conservative if the transaction in question is opt-in-RBF. --- src/qt/coincontroldialog.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/qt') diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 477cee1c04..c19420beb5 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -490,7 +490,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) else nBytesInputs += 148; } - bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET); + bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET, coinControl->signalRbf); // calculation if (nQuantity > 0) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index d9439fe248..27634eb179 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -166,6 +166,8 @@ void SendCoinsDialog::setModel(WalletModel *_model) connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); + connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel())); + connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); ui->customFee->setSingleStep(CWallet::GetRequiredFee(1000)); updateFeeSectionControls(); updateMinFeeLabel(); @@ -652,7 +654,7 @@ void SendCoinsDialog::updateSmartFeeLabel() int nBlocksToConfirm = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2; FeeCalculation feeCalc; - bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET); + bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET, ui->optInRBF->isChecked()); CFeeRate feeRate = ::feeEstimator.estimateSmartFee(nBlocksToConfirm, &feeCalc, ::mempool, conservative_estimate); if (feeRate <= CFeeRate(0)) // not enough data => minfee { @@ -828,6 +830,7 @@ void SendCoinsDialog::coinControlUpdateLabels() } else { CoinControlDialog::coinControl->nConfirmTarget = model->getDefaultConfirmTarget(); } + CoinControlDialog::coinControl->signalRbf = ui->optInRBF->isChecked(); for(int i = 0; i < ui->entries->count(); ++i) { -- cgit v1.2.3