@@ -652,7 +652,7 @@ void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)
652
652
if (ui->radioCustomFee ->isChecked ()) {
653
653
ctrl.m_feerate = CFeeRate (ui->customFee ->value ());
654
654
} else {
655
- ctrl.m_feerate = boost::none ;
655
+ ctrl.m_feerate . reset () ;
656
656
}
657
657
// Avoid using global defaults when sending money from the GUI
658
658
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
@@ -666,15 +666,13 @@ void SendCoinsDialog::updateSmartFeeLabel()
666
666
return ;
667
667
CCoinControl coin_control;
668
668
updateCoinControlState (coin_control);
669
- coin_control.m_feerate = boost::none ; // Explicitly use only fee estimation rate for smart fee labels
669
+ coin_control.m_feerate . reset () ; // Explicitly use only fee estimation rate for smart fee labels
670
670
FeeCalculation feeCalc;
671
- bool conservative_estimate = CalculateEstimateType (FeeEstimateMode::UNSET, coin_control.signalRbf );
672
- CFeeRate feeRate = ::feeEstimator.estimateSmartFee (*coin_control.m_confirm_target , &feeCalc, ::mempool, conservative_estimate);
671
+ CFeeRate feeRate = CFeeRate (CWallet::GetMinimumFee (1000 , coin_control, ::mempool, ::feeEstimator, &feeCalc));
673
672
674
- if (feeRate <= CFeeRate (0 )) // not enough data => minfee
675
- {
676
- ui->labelSmartFee ->setText (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (),
677
- std::max (CWallet::fallbackFee.GetFeePerK (), CWallet::GetRequiredFee (1000 ))) + " /kB" );
673
+ ui->labelSmartFee ->setText (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), feeRate.GetFeePerK ()) + " /kB" );
674
+
675
+ if (feeCalc.reason == FeeReason::FALLBACK) {
678
676
ui->labelSmartFee2 ->show (); // (Smart fee not initialized yet. This usually takes a few blocks...)
679
677
ui->labelFeeEstimation ->setText (" " );
680
678
ui->fallbackFeeWarningLabel ->setVisible (true );
@@ -685,8 +683,6 @@ void SendCoinsDialog::updateSmartFeeLabel()
685
683
}
686
684
else
687
685
{
688
- ui->labelSmartFee ->setText (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (),
689
- std::max (feeRate.GetFeePerK (), CWallet::GetRequiredFee (1000 ))) + " /kB" );
690
686
ui->labelSmartFee2 ->hide ();
691
687
ui->labelFeeEstimation ->setText (tr (" Estimated to begin confirmation within %n block(s)." , " " , feeCalc.returnedTarget ));
692
688
ui->fallbackFeeWarningLabel ->setVisible (false );
0 commit comments