MCPcopy Create free account
hub / github.com/ElementsProject/elements / updateSmartFeeLabel

Method updateSmartFeeLabel

src/qt/sendcoinsdialog.cpp:879–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879void SendCoinsDialog::updateSmartFeeLabel()
880{
881 if(!model || !model->getOptionsModel())
882 return;
883 updateCoinControlState();
884 m_coin_control->m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels
885 int returned_target;
886 FeeReason reason;
887 CFeeRate feeRate = CFeeRate(model->wallet().getMinimumFee(1000, *m_coin_control, &returned_target, &reason));
888
889 ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK()) + "/kvB");
890
891 if (reason == FeeReason::FALLBACK) {
892 ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...)
893 ui->labelFeeEstimation->setText("");
894 ui->fallbackFeeWarningLabel->setVisible(true);
895 int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
896 QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
897 ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }");
898 ui->fallbackFeeWarningLabel->setIndent(GUIUtil::TextWidth(QFontMetrics(ui->fallbackFeeWarningLabel->font()), "x"));
899 }
900 else
901 {
902 ui->labelSmartFee2->hide();
903 ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", returned_target));
904 ui->fallbackFeeWarningLabel->setVisible(false);
905 }
906
907 updateFeeMinimizedLabel();
908}
909
910// Coin Control: copy label "Quantity" to clipboard
911void SendCoinsDialog::coinControlClipboardQuantity()

Callers

nothing calls this directly

Calls 9

TextWidthFunction · 0.85
getMinimumFeeMethod · 0.80
setTextMethod · 0.80
getDisplayUnitMethod · 0.80
GetFeePerKMethod · 0.80
CFeeRateClass · 0.50
getOptionsModelMethod · 0.45
resetMethod · 0.45
walletMethod · 0.45

Tested by

no test coverage detected