aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-06-13 15:47:08 -0400
committerAlex Morcos <morcos@chaincode.com>2017-06-14 10:57:28 -0400
commite9cd7786da16cdf7e62ad5018fc6e842bbcbe83a (patch)
tree13f53e5fbf5badc29ef5e95836e1a39d866486c6 /src/qt
parent303c171b949be2c050f6f52e03b74ff1ad3dea63 (diff)
Pass in smart fee slider value to coin control dialog
Since cfe77ef41 the global nTxConfirmTarget wasn't being updated by the smart fee slider and thus the coin control dialog and labels were not being updated.
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/coincontroldialog.cpp4
-rw-r--r--src/qt/sendcoinsdialog.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index 1f14abf2c9..a61784dcfa 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -510,7 +510,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
nBytes -= 34;
// Fee
- nPayFee = CWallet::GetMinimumFee(nBytes, nTxConfirmTarget, ::mempool, ::feeEstimator);
+ nPayFee = CWallet::GetMinimumFee(nBytes, coinControl->nConfirmTarget, ::mempool, ::feeEstimator);
if (nPayAmount > 0)
{
@@ -588,7 +588,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
if (payTxFee.GetFeePerK() > 0)
dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), payTxFee.GetFeePerK()) / 1000;
else {
- dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), ::feeEstimator.estimateSmartFee(nTxConfirmTarget, NULL, ::mempool).GetFeePerK()) / 1000;
+ dFeeVary = (double)std::max(CWallet::GetRequiredFee(1000), ::feeEstimator.estimateSmartFee(coinControl->nConfirmTarget, NULL, ::mempool).GetFeePerK()) / 1000;
}
QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary);
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 272ab9486a..e63f744846 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -822,6 +822,12 @@ void SendCoinsDialog::coinControlUpdateLabels()
// set pay amounts
CoinControlDialog::payAmounts.clear();
CoinControlDialog::fSubtractFeeFromAmount = false;
+ if (ui->radioSmartFee->isChecked()) {
+ CoinControlDialog::coinControl->nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2;
+ } else {
+ CoinControlDialog::coinControl->nConfirmTarget = model->getDefaultConfirmTarget();
+ }
+
for(int i = 0; i < ui->entries->count(); ++i)
{
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());