electrum

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

commit 73e69284d1e8eee4f74f5b2f39e9d2240ac7324c
parent faa17f9818270f5a0ef2b8109b9d37bd52fd4c5f
Author: ThomasV <thomasv@electrum.org>
Date:   Mon,  3 Jul 2017 09:22:38 +0200

show pubkeys and redeem script in address dialog

Diffstat:
Mgui/qt/address_dialog.py | 22++++++++++++++++++++++
Mgui/qt/address_list.py | 3+--
Mgui/qt/main_window.py | 22----------------------
3 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/gui/qt/address_dialog.py b/gui/qt/address_dialog.py @@ -31,6 +31,7 @@ from PyQt4.QtCore import * from util import * from history_list import HistoryList +from qrtextedit import ShowQRTextEdit class AddressDialog(WindowModalDialog): @@ -54,6 +55,27 @@ class AddressDialog(WindowModalDialog): self.addr_e.setReadOnly(True) vbox.addWidget(self.addr_e) + try: + pubkeys = self.wallet.get_public_keys(address) + except BaseException as e: + pubkeys = None + if pubkeys: + vbox.addWidget(QLabel(_("Public keys") + ':')) + for pubkey in pubkeys: + pubkey_e = ButtonsLineEdit(pubkey) + pubkey_e.addCopyButton(self.app) + vbox.addWidget(pubkey_e) + + try: + redeem_script = self.wallet.pubkeys_to_redeem_script(pubkeys) + except BaseException as e: + redeem_script = None + if redeem_script: + vbox.addWidget(QLabel(_("Redeem Script") + ':')) + redeem_e = ShowQRTextEdit(text=redeem_script) + redeem_e.addCopyButton(self.app) + vbox.addWidget(redeem_e) + vbox.addWidget(QLabel(_("History"))) self.hw = HistoryList(self.parent) self.hw.get_domain = self.get_domain diff --git a/gui/qt/address_list.py b/gui/qt/address_list.py @@ -109,11 +109,10 @@ class AddressList(MyTreeWidget): if not multi_select: column_title = self.headerItem().text(col) menu.addAction(_("Copy %s")%column_title, lambda: self.parent.app.clipboard().setText(item.text(col))) + menu.addAction(_('Details'), lambda: self.parent.show_address(addr)) if col in self.editable_columns: menu.addAction(_("Edit %s")%column_title, lambda: self.editItem(item, col)) menu.addAction(_("Request payment"), lambda: self.parent.receive_at(addr)) - menu.addAction(_('History'), lambda: self.parent.show_address(addr)) - menu.addAction(_('Public Keys'), lambda: self.parent.show_public_keys(addr)) if self.wallet.can_export(): menu.addAction(_("Private key"), lambda: self.parent.show_private_key(addr)) if not is_multisig and not self.wallet.is_watching_only(): diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -1833,34 +1833,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): d = SeedDialog(self, seed, passphrase) d.exec_() - - def show_qrcode(self, data, title = _("QR code"), parent=None): if not data: return d = QRDialog(data, parent or self, title) d.exec_() - def show_public_keys(self, address): - if not address: return - try: - pubkey_list = self.wallet.get_public_keys(address) - except Exception as e: - traceback.print_exc(file=sys.stdout) - self.show_message(str(e)) - return - d = WindowModalDialog(self, _("Public key")) - d.setMinimumSize(600, 200) - vbox = QVBoxLayout() - vbox.addWidget( QLabel(_("Address") + ': ' + address)) - vbox.addWidget(QLabel(_("Public key") + ':')) - keys_e = ShowQRTextEdit(text='\n'.join(pubkey_list)) - keys_e.addCopyButton(self.app) - vbox.addWidget(keys_e) - vbox.addLayout(Buttons(CloseButton(d))) - d.setLayout(vbox) - d.exec_() - @protected def show_private_key(self, address, password): if not address: