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