| 877 | } |
| 878 | |
| 879 | void 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 |
| 911 | void SendCoinsDialog::coinControlClipboardQuantity() |
nothing calls this directly
no test coverage detected