@@ -585,7 +585,7 @@ void SendCoinsDialog::updateFeeSectionControls()
585
585
ui->checkBoxMinimumFee ->setEnabled (ui->radioCustomFee ->isChecked ());
586
586
ui->labelMinFeeWarning ->setEnabled (ui->radioCustomFee ->isChecked ());
587
587
ui->radioCustomPerKilobyte ->setEnabled (ui->radioCustomFee ->isChecked () && !ui->checkBoxMinimumFee ->isChecked ());
588
- ui->radioCustomAtLeast ->setEnabled (ui->radioCustomFee ->isChecked () && !ui->checkBoxMinimumFee ->isChecked ());
588
+ ui->radioCustomAtLeast ->setEnabled (ui->radioCustomFee ->isChecked () && !ui->checkBoxMinimumFee ->isChecked () && CoinControlDialog::coinControl-> HasSelected () );
589
589
ui->customFee ->setEnabled (ui->radioCustomFee ->isChecked () && !ui->checkBoxMinimumFee ->isChecked ());
590
590
}
591
591
@@ -600,7 +600,10 @@ void SendCoinsDialog::updateGlobalFeeVariables()
600
600
{
601
601
nTxConfirmTarget = defaultConfirmTarget;
602
602
payTxFee = CFeeRate (ui->customFee ->value ());
603
- fPayAtLeastCustomFee = ui->radioCustomAtLeast ->isChecked ();
603
+
604
+ // if user has selected to set a minimum absolute fee, pass the value to coincontrol
605
+ // set nMinimumTotalFee to 0 in case of user has selected that the fee is per KB
606
+ CoinControlDialog::coinControl->nMinimumTotalFee = ui->radioCustomAtLeast ->isChecked () ? ui->customFee ->value () : 0 ;
604
607
}
605
608
606
609
fSendFreeTransactions = ui->checkBoxFreeTx ->isChecked ();
@@ -707,8 +710,7 @@ void SendCoinsDialog::coinControlFeatureChanged(bool checked)
707
710
if (!checked && model) // coin control features disabled
708
711
CoinControlDialog::coinControl->SetNull ();
709
712
710
- if (checked)
711
- coinControlUpdateLabels ();
713
+ coinControlUpdateLabels ();
712
714
}
713
715
714
716
// Coin Control: button inputs -> show actual coin control dialog
@@ -782,9 +784,24 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text)
782
784
// Coin Control: update labels
783
785
void SendCoinsDialog::coinControlUpdateLabels ()
784
786
{
785
- if (!model || !model->getOptionsModel () || !model-> getOptionsModel ()-> getCoinControlFeatures () )
787
+ if (!model || !model->getOptionsModel ())
786
788
return ;
787
789
790
+ if (model->getOptionsModel ()->getCoinControlFeatures ())
791
+ {
792
+ // enable minium absolute fee UI controls
793
+ ui->radioCustomAtLeast ->setVisible (true );
794
+
795
+ // only enable the feature if inputs are selected
796
+ ui->radioCustomAtLeast ->setEnabled (CoinControlDialog::coinControl->HasSelected ());
797
+ }
798
+ else
799
+ {
800
+ // in case coin control is disabled (=default), hide minimum absolute fee UI controls
801
+ ui->radioCustomAtLeast ->setVisible (false );
802
+ return ;
803
+ }
804
+
788
805
// set pay amounts
789
806
CoinControlDialog::payAmounts.clear ();
790
807
CoinControlDialog::fSubtractFeeFromAmount = false ;
0 commit comments