From a9cd9c633fe7a7e5ad60131207140dbd721152c0 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 22 Oct 2024 15:06:26 +0000 Subject: [PATCH] qt tx_dialog: also show high-fee warnings for self-payments e.g. if you consolidate own utxos, the "amount sent" in the dialog is zero, but for high fee warnings that's not the amount we should be comparing against --- electrum/gui/qt/transaction_dialog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py index 2bd66b357..f97d3b617 100644 --- a/electrum/gui/qt/transaction_dialog.py +++ b/electrum/gui/qt/transaction_dialog.py @@ -905,7 +905,8 @@ class TxDialog(QDialog, MessageBoxMixin): fee_rate = Decimal(fee) / size # sat/byte fee_str += ' ( %s ) ' % self.main_window.format_fee_rate(fee_rate * 1000) if isinstance(self.tx, PartialTransaction): - invoice_amt = abs(amount) + # 'amount' is zero for self-payments, so in that case we use sum-of-outputs + invoice_amt = abs(amount) or self.tx.output_value() fee_warning_tuple = self.wallet.get_tx_fee_warning( invoice_amt=invoice_amt, tx_size=size, fee=fee) if fee_warning_tuple: