From b9bb78a1db47343355b0fad7d7a5db711e504df2 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 1 May 2020 07:34:11 +0200 Subject: [PATCH] qt ConfirmTxDialog: fix exc for "max" invoice when "not enough funds" "not enough funds" is possible even for "max" invoice due to fees fixes #6136 --- electrum/gui/qt/confirm_tx_dialog.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 8b10598fd..b67036be1 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -197,10 +197,22 @@ class ConfirmTxDialog(TxEditor, WindowModalDialog): self.pw.setEnabled(True) self.send_button.setEnabled(True) + def _update_amount_label(self): + tx = self.tx + if self.output_value == '!': + if tx: + amount = tx.output_value() + amount_str = self.main_window.format_amount_and_units(amount) + else: + amount_str = "max" + else: + amount = self.output_value + amount_str = self.main_window.format_amount_and_units(amount) + self.amount_label.setText(amount_str) + def update(self): tx = self.tx - amount = tx.output_value() if self.output_value == '!' else self.output_value - self.amount_label.setText(self.main_window.format_amount_and_units(amount)) + self._update_amount_label() if self.not_enough_funds: text = _("Not enough funds")