Browse Source

[Qt] add defaultConfirmTarget constant to sendcoinsdialog

- replaces some hard-coded values for the default confirmation target
- also simplify code that is using the new constant
0.13
Philip Kaufmann 10 years ago committed by Gavin Andresen
parent
commit
e656560edb
No known key found for this signature in database
GPG Key ID: 7588242FBE38D3A8
  1. 6
      src/qt/sendcoinsdialog.cpp
  2. 2
      src/qt/sendcoinsdialog.h

6
src/qt/sendcoinsdialog.cpp

@ -590,12 +590,12 @@ void SendCoinsDialog::updateGlobalFeeVariables()
{ {
if (ui->radioSmartFee->isChecked()) if (ui->radioSmartFee->isChecked())
{ {
nTxConfirmTarget = (int)25 - (int)std::max(0, std::min(24, ui->sliderSmartFee->value())); nTxConfirmTarget = defaultConfirmTarget - ui->sliderSmartFee->value();
payTxFee = CFeeRate(0); payTxFee = CFeeRate(0);
} }
else else
{ {
nTxConfirmTarget = 25; nTxConfirmTarget = defaultConfirmTarget;
payTxFee = CFeeRate(ui->customFee->value()); payTxFee = CFeeRate(ui->customFee->value());
fPayAtLeastCustomFee = ui->radioCustomAtLeast->isChecked(); fPayAtLeastCustomFee = ui->radioCustomAtLeast->isChecked();
} }
@ -629,7 +629,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
if(!model || !model->getOptionsModel()) if(!model || !model->getOptionsModel())
return; return;
int nBlocksToConfirm = (int)25 - (int)std::max(0, std::min(24, ui->sliderSmartFee->value())); int nBlocksToConfirm = defaultConfirmTarget - ui->sliderSmartFee->value();
CFeeRate feeRate = mempool.estimateFee(nBlocksToConfirm); CFeeRate feeRate = mempool.estimateFee(nBlocksToConfirm);
if (feeRate <= CFeeRate(0)) // not enough data => minfee if (feeRate <= CFeeRate(0)) // not enough data => minfee
{ {

2
src/qt/sendcoinsdialog.h

@ -23,6 +23,8 @@ QT_BEGIN_NAMESPACE
class QUrl; class QUrl;
QT_END_NAMESPACE QT_END_NAMESPACE
const int defaultConfirmTarget = 25;
/** Dialog for sending bitcoins */ /** Dialog for sending bitcoins */
class SendCoinsDialog : public QDialog class SendCoinsDialog : public QDialog
{ {

Loading…
Cancel
Save