1
0

wizard: fix trezor device initialization

This commit is contained in:
ThomasV
2016-08-23 09:21:24 +02:00
parent 80675121ce
commit 3b830cbcfa
3 changed files with 49 additions and 74 deletions

View File

@@ -284,30 +284,6 @@ def qt_plugin_class(base_plugin_class):
# Trigger a pairing
keystore.thread.add(partial(self.get_client, keystore))
def create_keystore(self, hw_type, derivation, wizard):
from electrum.keystore import hardware_keystore
handler = self.create_handler(wizard)
thread = TaskThread(wizard, wizard.on_error)
# Setup device and create accounts in separate thread; wait until done
loop = QEventLoop()
exc_info = []
self.setup_device(derivation, thread, handler, on_done=loop.quit,
on_error=lambda info: exc_info.extend(info))
loop.exec_()
# If an exception was thrown, show to user and exit install wizard
if exc_info:
wizard.on_error(exc_info)
raise UserCancelled
# create keystore
d = {
'xpub': self.xpub,
'type': 'hardware',
'hw_type': hw_type,
'derivation': derivation
}
k = hardware_keystore(hw_type, d)
return k
@hook
def receive_menu(self, menu, addrs, wallet):
for keystore in wallet.get_keystores():