Browse Source
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
master
SomberNight
5 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
14 additions and
2 deletions
-
electrum/gui/qt/confirm_tx_dialog.py
|
@ -197,10 +197,22 @@ class ConfirmTxDialog(TxEditor, WindowModalDialog): |
|
|
self.pw.setEnabled(True) |
|
|
self.pw.setEnabled(True) |
|
|
self.send_button.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): |
|
|
def update(self): |
|
|
tx = self.tx |
|
|
tx = self.tx |
|
|
amount = tx.output_value() if self.output_value == '!' else self.output_value |
|
|
self._update_amount_label() |
|
|
self.amount_label.setText(self.main_window.format_amount_and_units(amount)) |
|
|
|
|
|
|
|
|
|
|
|
if self.not_enough_funds: |
|
|
if self.not_enough_funds: |
|
|
text = _("Not enough funds") |
|
|
text = _("Not enough funds") |
|
|