Browse Source

qt PreviewTxDialog: check for "not enough funds" also when shortcutting

see https://github.com/spesmilo/electrum/issues/6306#issuecomment-652424363

scenario: user saves invoice for more money than they have, has advanced_preview
in config enabled, tries to pay it, half-empty tx preview dialog opens
bip39-recovery
SomberNight 5 years ago
parent
commit
844bbd103a
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 11
      electrum/gui/qt/main_window.py

11
electrum/gui/qt/main_window.py

@ -1613,10 +1613,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
if output_values.count('!') > 1:
self.show_error(_("More than one output set to spend max"))
return
if self.config.get('advanced_preview'):
self.preview_tx_dialog(make_tx=make_tx,
external_keypairs=external_keypairs)
return
output_value = '!' if '!' in output_values else sum(output_values)
d = ConfirmTxDialog(window=self, make_tx=make_tx, output_value=output_value, is_sweep=is_sweep)
@ -1626,6 +1622,13 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
if not d.have_enough_funds_assuming_zero_fees():
self.show_message(_('Not Enough Funds'))
return
# shortcut to advanced preview (after "enough funds" check!)
if self.config.get('advanced_preview'):
self.preview_tx_dialog(make_tx=make_tx,
external_keypairs=external_keypairs)
return
cancelled, is_send, password, tx = d.run()
if cancelled:
return

Loading…
Cancel
Save