Browse Source

qt tx dlg: fix showing fee warnings

In qt, only the confirm_tx_dialog was showing the fee warnings, the transaction_dialog was not...

regression from bc3946d2f4
master
SomberNight 1 year ago
parent
commit
e84679982e
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/gui/qt/transaction_dialog.py
  2. 2
      electrum/wallet.py

2
electrum/gui/qt/transaction_dialog.py

@ -905,7 +905,7 @@ 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 = amount
invoice_amt = abs(amount)
fee_warning_tuple = self.wallet.get_tx_fee_warning(
invoice_amt=invoice_amt, tx_size=size, fee=fee)
if fee_warning_tuple:

2
electrum/wallet.py

@ -3178,6 +3178,8 @@ class Abstract_Wallet(ABC, Logger, EventListener):
tx_size: int,
fee: int) -> Optional[Tuple[bool, str, str]]:
assert invoice_amt >= 0, f"{invoice_amt=!r} must be non-negative satoshis"
assert fee >= 0, f"{fee=!r} must be non-negative satoshis"
feerate = Decimal(fee) / tx_size # sat/byte
fee_ratio = Decimal(fee) / invoice_amt if invoice_amt else 0
long_warning = None

Loading…
Cancel
Save