Skip to content

Commit e9cd778

Browse files
committed
Pass in smart fee slider value to coin control dialog
Since cfe77ef the global nTxConfirmTarget wasn't being updated by the smart fee slider and thus the coin control dialog and labels were not being updated.
1 parent 303c171 commit e9cd778

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
510510
nBytes -= 34;
511511

512512
// Fee
513-
nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, ::mempool, ::feeEstimator);
513+
nPayFee = CWallet::GetMinimumFee(nBytes, coinControl->nConfirmTarget, ::mempool, ::feeEstimator);
514514

515515
if (nPayAmount > 0)
516516
{
@@ -588,7 +588,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
588588
if (payTxFee.GetFeePerK() > 0)
589589
dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), payTxFee.GetFeePerK()) / 1000;
590590
else {
591-
dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), ::feeEstimator.estimateSmartFee(nTxConfirmTarget, NULL, ::mempool).GetFeePerK()) / 1000;
591+
dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), ::feeEstimator.estimateSmartFee(coinControl->nConfirmTarget, NULL, ::mempool).GetFeePerK()) / 1000;
592592
}
593593
QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary);
594594

src/qt/sendcoinsdialog.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,12 @@ void SendCoinsDialog::coinControlUpdateLabels()
822822
// set pay amounts
823823
CoinControlDialog::payAmounts.clear();
824824
CoinControlDialog::fSubtractFeeFromAmount = false;
825+
if (ui->radioSmartFee->isChecked()) {
826+
CoinControlDialog::coinControl->nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2;
827+
} else {
828+
CoinControlDialog::coinControl->nConfirmTarget = model->getDefaultConfirmTarget();
829+
}
830+
825831
for(int i = 0; i < ui->entries->count(); ++i)
826832
{
827833
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());

0 commit comments

Comments
 (0)