Skip to content

Commit ce01e62

Browse files
committed
Merge #9481: [Qt] Show more significant warning if we fall back to the default fee
7abe7bb Qt/Send: Give fallback fee a reasonable indent (Luke Dashjr) 3e4d7bf Qt/Send: Figure a decent warning colour from theme (Luke Dashjr) c5adf8f [Qt] Show more significant warning if we fall back to the default fee (Jonas Schnelli) Tree-SHA512: 9e85b5b398d7a49aaf6c42578d63750b1b7aa9cc9e84d008fe21d6c53f1ffe2fb69286a1a764e634ebca3286564615578eea0a1bc883e4b332be8306d9883d14
2 parents 416809c + 7abe7bb commit ce01e62

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/qt/forms/sendcoinsdialog.ui

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,33 @@
759759
</item>
760760
</layout>
761761
</item>
762+
<item>
763+
<widget class="QLabel" name="fallbackFeeWarningLabel">
764+
<property name="toolTip">
765+
<string>Using the fallbackfee can result in sending a transaction that will take serval hours or days (or never) to confirm. Consider choosing your fee manually or wait until your have validated the complete chain.</string>
766+
</property>
767+
<property name="font">
768+
<font>
769+
<weight>75</weight>
770+
<bold>true</bold>
771+
</font>
772+
</property>
773+
<property name="text">
774+
<string>Warning: Fee estimation is currently not possible.</string>
775+
</property>
776+
<property name="wordWrap">
777+
<bool>false</bool>
778+
</property>
779+
</widget>
780+
</item>
762781
<item>
763782
<spacer name="horizontalSpacer_4">
764783
<property name="orientation">
765784
<enum>Qt::Horizontal</enum>
766785
</property>
786+
<property name="sizeType">
787+
<enum>QSizePolicy::MinimumExpanding</enum>
788+
</property>
767789
<property name="sizeHint" stdset="0">
768790
<size>
769791
<width>40</width>

src/qt/sendcoinsdialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "txmempool.h"
2424
#include "wallet/wallet.h"
2525

26+
#include <QFontMetrics>
2627
#include <QMessageBox>
2728
#include <QScrollBar>
2829
#include <QSettings>
@@ -656,13 +657,19 @@ void SendCoinsDialog::updateSmartFeeLabel()
656657
std::max(CWallet::fallbackFee.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB");
657658
ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...)
658659
ui->labelFeeEstimation->setText("");
660+
ui->fallbackFeeWarningLabel->setVisible(true);
661+
int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
662+
QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
663+
ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }");
664+
ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width("x"));
659665
}
660666
else
661667
{
662668
ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(),
663669
std::max(feeRate.GetFeePerK(), CWallet::GetRequiredFee(1000))) + "/kB");
664670
ui->labelSmartFee2->hide();
665671
ui->labelFeeEstimation->setText(tr("Estimated to begin confirmation within %n block(s).", "", estimateFoundAtBlocks));
672+
ui->fallbackFeeWarningLabel->setVisible(false);
666673
}
667674

668675
updateFeeMinimizedLabel();

0 commit comments

Comments
 (0)