From e74f7e7b42aedaf862cd937bf64c3193910dbc47 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 17 Nov 2019 13:48:19 +0100 Subject: [PATCH] fix #5764 --- electrum/gui/qt/main_window.py | 8 ++++---- electrum/gui/qt/transaction_dialog.py | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index c42970f45..93f13e143 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -1488,7 +1488,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): fee=fee_est, is_sweep=is_sweep) if self.config.get('advanced_preview'): - self.preview_tx_dialog(make_tx, outputs, is_sweep=is_sweep, invoice=invoice) + self.preview_tx_dialog(make_tx, outputs, external_keypairs=external_keypairs, invoice=invoice) return output_values = [x.value for x in outputs] @@ -1507,10 +1507,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.broadcast_or_show(tx, invoice=invoice) self.sign_tx_with_password(tx, sign_done, password, external_keypairs) else: - self.preview_tx_dialog(make_tx, outputs, is_sweep=is_sweep, invoice=invoice) + self.preview_tx_dialog(make_tx, outputs, external_keypairs=external_keypairs, invoice=invoice) - def preview_tx_dialog(self, make_tx, outputs, is_sweep=False, invoice=None): - d = PreviewTxDialog(make_tx, outputs, is_sweep, window=self, invoice=invoice) + def preview_tx_dialog(self, make_tx, outputs, external_keypairs=None, invoice=None): + d = PreviewTxDialog(make_tx, outputs, external_keypairs, window=self, invoice=invoice) d.show() def broadcast_or_show(self, tx, invoice=None): diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py index db6d40477..6342b17b4 100644 --- a/electrum/gui/qt/transaction_dialog.py +++ b/electrum/gui/qt/transaction_dialog.py @@ -92,13 +92,14 @@ def show_transaction(tx: Transaction, *, parent: 'ElectrumWindow', invoice=None, class BaseTxDialog(QDialog, MessageBoxMixin): - def __init__(self, *, parent: 'ElectrumWindow', invoice, desc, prompt_if_unsaved, finalized: bool): + def __init__(self, *, parent: 'ElectrumWindow', invoice, desc, prompt_if_unsaved, finalized: bool, external_keypairs=None): '''Transactions in the wallet will show their description. Pass desc to give a description for txs not yet in the wallet. ''' # We want to be a top-level window QDialog.__init__(self, parent=None) self.tx = None # type: Optional[Transaction] + self.external_keypairs = external_keypairs self.finalized = finalized self.main_window = parent self.config = parent.config @@ -602,9 +603,9 @@ class TxDialog(BaseTxDialog): class PreviewTxDialog(BaseTxDialog, TxEditor): - def __init__(self, make_tx, outputs, is_sweep, *, window: 'ElectrumWindow', invoice): - TxEditor.__init__(self, window, make_tx, outputs, is_sweep) - BaseTxDialog.__init__(self, parent=window, invoice=invoice, desc='', prompt_if_unsaved=False, finalized=False) + def __init__(self, make_tx, outputs, external_keypairs, *, window: 'ElectrumWindow', invoice): + TxEditor.__init__(self, window, make_tx, outputs, is_sweep=bool(external_keypairs)) + BaseTxDialog.__init__(self, parent=window, invoice=invoice, desc='', prompt_if_unsaved=False, finalized=False, external_keypairs=external_keypairs) self.update_tx() self.update()