electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 844bbd103a48f8def6365e7d331b588c12d7a04f
parent 27d03441d3dd0215d065af504d40a6a5474dd9af
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu,  2 Jul 2020 13:25:31 +0200

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

Diffstat:
Melectrum/gui/qt/main_window.py | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/electrum/gui/qt/main_window.py b/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