mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
fix #5764
This commit is contained in:
parent
cbd146ad15
commit
e74f7e7b42
2 changed files with 9 additions and 8 deletions
|
@ -1488,7 +1488,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||||
fee=fee_est,
|
fee=fee_est,
|
||||||
is_sweep=is_sweep)
|
is_sweep=is_sweep)
|
||||||
if self.config.get('advanced_preview'):
|
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
|
return
|
||||||
|
|
||||||
output_values = [x.value for x in outputs]
|
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.broadcast_or_show(tx, invoice=invoice)
|
||||||
self.sign_tx_with_password(tx, sign_done, password, external_keypairs)
|
self.sign_tx_with_password(tx, sign_done, password, external_keypairs)
|
||||||
else:
|
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):
|
def preview_tx_dialog(self, make_tx, outputs, external_keypairs=None, invoice=None):
|
||||||
d = PreviewTxDialog(make_tx, outputs, is_sweep, window=self, invoice=invoice)
|
d = PreviewTxDialog(make_tx, outputs, external_keypairs, window=self, invoice=invoice)
|
||||||
d.show()
|
d.show()
|
||||||
|
|
||||||
def broadcast_or_show(self, tx, invoice=None):
|
def broadcast_or_show(self, tx, invoice=None):
|
||||||
|
|
|
@ -92,13 +92,14 @@ def show_transaction(tx: Transaction, *, parent: 'ElectrumWindow', invoice=None,
|
||||||
|
|
||||||
class BaseTxDialog(QDialog, MessageBoxMixin):
|
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.
|
'''Transactions in the wallet will show their description.
|
||||||
Pass desc to give a description for txs not yet in the wallet.
|
Pass desc to give a description for txs not yet in the wallet.
|
||||||
'''
|
'''
|
||||||
# We want to be a top-level window
|
# We want to be a top-level window
|
||||||
QDialog.__init__(self, parent=None)
|
QDialog.__init__(self, parent=None)
|
||||||
self.tx = None # type: Optional[Transaction]
|
self.tx = None # type: Optional[Transaction]
|
||||||
|
self.external_keypairs = external_keypairs
|
||||||
self.finalized = finalized
|
self.finalized = finalized
|
||||||
self.main_window = parent
|
self.main_window = parent
|
||||||
self.config = parent.config
|
self.config = parent.config
|
||||||
|
@ -602,9 +603,9 @@ class TxDialog(BaseTxDialog):
|
||||||
|
|
||||||
class PreviewTxDialog(BaseTxDialog, TxEditor):
|
class PreviewTxDialog(BaseTxDialog, TxEditor):
|
||||||
|
|
||||||
def __init__(self, make_tx, outputs, is_sweep, *, window: 'ElectrumWindow', invoice):
|
def __init__(self, make_tx, outputs, external_keypairs, *, window: 'ElectrumWindow', invoice):
|
||||||
TxEditor.__init__(self, window, make_tx, outputs, is_sweep)
|
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)
|
BaseTxDialog.__init__(self, parent=window, invoice=invoice, desc='', prompt_if_unsaved=False, finalized=False, external_keypairs=external_keypairs)
|
||||||
self.update_tx()
|
self.update_tx()
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue