electrum

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

commit 3fb75bc6063c9e527d19c20cb75f32e70ef65a15
parent 45b03d930df44352558dc408168894967547c07b
Author: SomberNight <somber.night@protonmail.com>
Date:   Sun, 18 Mar 2018 01:46:09 +0100

dbb: do show_address in different thread

Diffstat:
Mplugins/digitalbitbox/digitalbitbox.py | 10++++++++++
Mplugins/digitalbitbox/qt.py | 11+++--------
2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/plugins/digitalbitbox/digitalbitbox.py b/plugins/digitalbitbox/digitalbitbox.py @@ -724,3 +724,13 @@ class DigitalBitboxPlugin(HW_PluginBase): if client is not None: client.check_device_dialog() return client + + def show_address(self, wallet, keystore, address): + change, index = wallet.get_address_index(address) + keypath = '%s/%d/%d' % (keystore.derivation, change, index) + xpub = self.get_client(keystore)._get_xpub(keypath) + verify_request_payload = { + "type": 'p2pkh', + "echo": xpub['echo'], + } + self.comserver_post_notification(verify_request_payload) diff --git a/plugins/digitalbitbox/qt.py b/plugins/digitalbitbox/qt.py @@ -1,3 +1,5 @@ +from functools import partial + from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from .digitalbitbox import DigitalBitboxPlugin @@ -30,14 +32,7 @@ class Plugin(DigitalBitboxPlugin, QtPluginBase): if len(addrs) == 1: def show_address(): - change, index = wallet.get_address_index(addrs[0]) - keypath = '%s/%d/%d' % (keystore.derivation, change, index) - xpub = self.get_client(keystore)._get_xpub(keypath) - verify_request_payload = { - "type": 'p2pkh', - "echo": xpub['echo'], - } - self.comserver_post_notification(verify_request_payload) + keystore.thread.add(partial(self.show_address, wallet, keystore, addrs[0])) menu.addAction(_("Show on {}").format(self.device), show_address)