mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
Make GUI incapable of setting tx confirm target of 1
This commit is contained in:
parent
d824ad030e
commit
e878689e55
2 changed files with 5 additions and 5 deletions
|
@ -1064,7 +1064,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>24</number>
|
<number>23</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="pageStep">
|
<property name="pageStep">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
|
|
@ -175,7 +175,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
||||||
// set the smartfee-sliders default value (wallets default conf.target or last stored value)
|
// set the smartfee-sliders default value (wallets default conf.target or last stored value)
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
if (settings.value("nSmartFeeSliderPosition").toInt() == 0)
|
if (settings.value("nSmartFeeSliderPosition").toInt() == 0)
|
||||||
ui->sliderSmartFee->setValue(ui->sliderSmartFee->maximum() - model->getDefaultConfirmTarget() + 1);
|
ui->sliderSmartFee->setValue(ui->sliderSmartFee->maximum() - model->getDefaultConfirmTarget() + 2);
|
||||||
else
|
else
|
||||||
ui->sliderSmartFee->setValue(settings.value("nSmartFeeSliderPosition").toInt());
|
ui->sliderSmartFee->setValue(settings.value("nSmartFeeSliderPosition").toInt());
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||||
if (model->getOptionsModel()->getCoinControlFeatures())
|
if (model->getOptionsModel()->getCoinControlFeatures())
|
||||||
ctrl = *CoinControlDialog::coinControl;
|
ctrl = *CoinControlDialog::coinControl;
|
||||||
if (ui->radioSmartFee->isChecked())
|
if (ui->radioSmartFee->isChecked())
|
||||||
ctrl.nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 1;
|
ctrl.nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2;
|
||||||
else
|
else
|
||||||
ctrl.nConfirmTarget = 0;
|
ctrl.nConfirmTarget = 0;
|
||||||
|
|
||||||
|
@ -601,7 +601,7 @@ void SendCoinsDialog::updateGlobalFeeVariables()
|
||||||
{
|
{
|
||||||
if (ui->radioSmartFee->isChecked())
|
if (ui->radioSmartFee->isChecked())
|
||||||
{
|
{
|
||||||
int nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 1;
|
int nConfirmTarget = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2;
|
||||||
payTxFee = CFeeRate(0);
|
payTxFee = CFeeRate(0);
|
||||||
|
|
||||||
// set nMinimumTotalFee to 0 to not accidentally pay a custom fee
|
// set nMinimumTotalFee to 0 to not accidentally pay a custom fee
|
||||||
|
@ -646,7 +646,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
|
||||||
if(!model || !model->getOptionsModel())
|
if(!model || !model->getOptionsModel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int nBlocksToConfirm = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 1;
|
int nBlocksToConfirm = ui->sliderSmartFee->maximum() - ui->sliderSmartFee->value() + 2;
|
||||||
int estimateFoundAtBlocks = nBlocksToConfirm;
|
int estimateFoundAtBlocks = nBlocksToConfirm;
|
||||||
CFeeRate feeRate = mempool.estimateSmartFee(nBlocksToConfirm, &estimateFoundAtBlocks);
|
CFeeRate feeRate = mempool.estimateSmartFee(nBlocksToConfirm, &estimateFoundAtBlocks);
|
||||||
if (feeRate <= CFeeRate(0)) // not enough data => minfee
|
if (feeRate <= CFeeRate(0)) // not enough data => minfee
|
||||||
|
|
Loading…
Reference in a new issue