1
0

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
This commit is contained in:
SomberNight
2020-07-02 13:25:31 +02:00
parent 27d03441d3
commit 844bbd103a

View File

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