1
0

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
This commit is contained in:
SomberNight
2024-10-16 12:42:58 +00:00
parent 4bc63384d6
commit e84679982e
2 changed files with 3 additions and 1 deletions

View File

@@ -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:

View File

@@ -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