18
18
#include < interface/node.h>
19
19
#include < key_io.h>
20
20
#include < wallet/coincontrol.h>
21
- #include < validation.h> // mempool and minRelayTxFee
22
21
#include < ui_interface.h>
23
22
#include < txmempool.h>
24
23
#include < policy/fees.h>
@@ -177,7 +176,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
177
176
connect (ui->checkBoxMinimumFee , SIGNAL (stateChanged (int )), this , SLOT (coinControlUpdateLabels ()));
178
177
connect (ui->optInRBF , SIGNAL (stateChanged (int )), this , SLOT (updateSmartFeeLabel ()));
179
178
connect (ui->optInRBF , SIGNAL (stateChanged (int )), this , SLOT (coinControlUpdateLabels ()));
180
- ui->customFee ->setSingleStep (GetRequiredFee (1000 ));
179
+ ui->customFee ->setSingleStep (model-> node (). getRequiredFee (1000 ));
181
180
updateFeeSectionControls ();
182
181
updateMinFeeLabel ();
183
182
updateSmartFeeLabel ();
@@ -575,7 +574,7 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn
575
574
msgParams.second = CClientUIInterface::MSG_ERROR;
576
575
break ;
577
576
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 () ));
579
578
break ;
580
579
case WalletModel::PaymentRequestExpired:
581
580
msgParams.first = tr (" Payment request expired." );
@@ -638,7 +637,7 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
638
637
639
638
void SendCoinsDialog::setMinimumFee ()
640
639
{
641
- ui->customFee ->setValue (GetRequiredFee (1000 ));
640
+ ui->customFee ->setValue (model-> node (). getRequiredFee (1000 ));
642
641
}
643
642
644
643
void SendCoinsDialog::updateFeeSectionControls ()
@@ -670,7 +669,7 @@ void SendCoinsDialog::updateMinFeeLabel()
670
669
{
671
670
if (model && model->getOptionsModel ())
672
671
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" )
674
673
);
675
674
}
676
675
@@ -694,12 +693,13 @@ void SendCoinsDialog::updateSmartFeeLabel()
694
693
CCoinControl coin_control;
695
694
updateCoinControlState (coin_control);
696
695
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));
699
699
700
700
ui->labelSmartFee ->setText (BitcoinUnits::formatWithUnit (model->getOptionsModel ()->getDisplayUnit (), feeRate.GetFeePerK ()) + " /kB" );
701
701
702
- if (feeCalc. reason == FeeReason::FALLBACK) {
702
+ if (reason == FeeReason::FALLBACK) {
703
703
ui->labelSmartFee2 ->show (); // (Smart fee not initialized yet. This usually takes a few blocks...)
704
704
ui->labelFeeEstimation ->setText (" " );
705
705
ui->fallbackFeeWarningLabel ->setVisible (true );
@@ -711,7 +711,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
711
711
else
712
712
{
713
713
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 ));
715
715
ui->fallbackFeeWarningLabel ->setVisible (false );
716
716
}
717
717
0 commit comments