1818#include < interface/node.h>
1919#include < key_io.h>
2020#include < wallet/coincontrol.h>
21- #include < validation.h> // mempool and minRelayTxFee
2221#include < ui_interface.h>
2322#include < txmempool.h>
2423#include < policy/fees.h>
@@ -177,7 +176,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
177176 connect (ui->checkBoxMinimumFee , SIGNAL (stateChanged (int )), this , SLOT (coinControlUpdateLabels ()));
178177 connect (ui->optInRBF , SIGNAL (stateChanged (int )), this , SLOT (updateSmartFeeLabel ()));
179178 connect (ui->optInRBF , SIGNAL (stateChanged (int )), this , SLOT (coinControlUpdateLabels ()));
180- ui->customFee ->setSingleStep (GetRequiredFee (1000 ));
179+ ui->customFee ->setSingleStep (model-> node (). getRequiredFee (1000 ));
181180 updateFeeSectionControls ();
182181 updateMinFeeLabel ();
183182 updateSmartFeeLabel ();
@@ -575,7 +574,7 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn
575574 msgParams.second = CClientUIInterface::MSG_ERROR;
576575 break ;
577576 case WalletModel::AbsurdFee:
578- msgParams.first = tr (" A fee higher than %1 is considered an absurdly high fee." ).arg (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), maxTxFee ));
577+ msgParams.first = tr (" A fee higher than %1 is considered an absurdly high fee." ).arg (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), model-> node (). getMaxTxFee () ));
579578 break ;
580579 case WalletModel::PaymentRequestExpired:
581580 msgParams.first = tr (" Payment request expired." );
@@ -638,7 +637,7 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
638637
639638void SendCoinsDialog::setMinimumFee ()
640639{
641- ui->customFee ->setValue (GetRequiredFee (1000 ));
640+ ui->customFee ->setValue (model-> node (). getRequiredFee (1000 ));
642641}
643642
644643void SendCoinsDialog::updateFeeSectionControls ()
@@ -670,7 +669,7 @@ void SendCoinsDialog::updateMinFeeLabel()
670669{
671670 if (model && model->getOptionsModel ())
672671 ui->checkBoxMinimumFee ->setText (tr (" Pay only the required fee of %1" ).arg (
673- BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), GetRequiredFee (1000 )) + " /kB" )
672+ BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), model-> node (). getRequiredFee (1000 )) + " /kB" )
674673 );
675674}
676675
@@ -694,12 +693,13 @@ void SendCoinsDialog::updateSmartFeeLabel()
694693 CCoinControl coin_control;
695694 updateCoinControlState (coin_control);
696695 coin_control.m_feerate .reset (); // Explicitly use only fee estimation rate for smart fee labels
697- FeeCalculation feeCalc;
698- CFeeRate feeRate = CFeeRate (GetMinimumFee (1000 , coin_control, ::mempool, ::feeEstimator, &feeCalc));
696+ int returned_target;
697+ FeeReason reason;
698+ CFeeRate feeRate = CFeeRate (model->node ().getMinimumFee (1000 , coin_control, &returned_target, &reason));
699699
700700 ui->labelSmartFee ->setText (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), feeRate.GetFeePerK ()) + " /kB" );
701701
702- if (feeCalc. reason == FeeReason::FALLBACK) {
702+ if (reason == FeeReason::FALLBACK) {
703703 ui->labelSmartFee2 ->show (); // (Smart fee not initialized yet. This usually takes a few blocks...)
704704 ui->labelFeeEstimation ->setText (" " );
705705 ui->fallbackFeeWarningLabel ->setVisible (true );
@@ -711,7 +711,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
711711 else
712712 {
713713 ui->labelSmartFee2 ->hide ();
714- ui->labelFeeEstimation ->setText (tr (" Estimated to begin confirmation within %n block(s)." , " " , feeCalc. returnedTarget ));
714+ ui->labelFeeEstimation ->setText (tr (" Estimated to begin confirmation within %n block(s)." , " " , returned_target ));
715715 ui->fallbackFeeWarningLabel ->setVisible (false );
716716 }
717717
0 commit comments