| 686 | } |
| 687 | |
| 688 | void SendCoinsDialog::updateSmartFeeLabel() |
| 689 | { |
| 690 | if(!model || !model->getOptionsModel()) |
| 691 | return; |
| 692 | CCoinControl coin_control; |
| 693 | updateCoinControlState(coin_control); |
| 694 | coin_control.m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels |
| 695 | int returned_target; |
| 696 | FeeReason reason; |
| 697 | CFeeRate feeRate = CFeeRate(model->wallet().getMinimumFee(1000, coin_control, &returned_target, &reason)); |
| 698 | |
| 699 | ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK()) + "/kB"); |
| 700 | |
| 701 | if (reason == FeeReason::FALLBACK) { |
| 702 | ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...) |
| 703 | ui->labelFeeEstimation->setText(""); |
| 704 | ui->fallbackFeeWarningLabel->setVisible(true); |
| 705 | int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness(); |
| 706 | QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14)); |
| 707 | ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }"); |
| 708 | ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width("x")); |
| 709 | } |
| 710 | else |
| 711 | { |
| 712 | ui->labelSmartFee2->hide(); |
| 713 | ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", returned_target)); |
| 714 | ui->fallbackFeeWarningLabel->setVisible(false); |
| 715 | } |
| 716 | |
| 717 | updateFeeMinimizedLabel(); |
| 718 | } |
| 719 | |
| 720 | // Coin Control: copy label "Quantity" to clipboard |
| 721 | void SendCoinsDialog::coinControlClipboardQuantity() |
nothing calls this directly
no test coverage detected