1
0

Proper treatment of restored hardware wallets

They have a different wallet type; they require no plugin nor
plugin libraries to use.

Remove pointless public key code that was implemented in the
base classes already.

Partial fix for #1592.  Unfortunately the plugin and library
are still required to actually restore the wallet, but for
no reason that isn't fixable.
This commit is contained in:
Neil Booth
2015-12-28 20:24:15 +09:00
parent b50ace4225
commit 9d9fcbde64
3 changed files with 59 additions and 81 deletions

View File

@@ -135,8 +135,11 @@ class QtPlugin(TrezorPlugin):
None, func=lambda x: True)
if not seed:
return
wallet = self.wallet_class(storage)
self.wallet = wallet
# Restored wallets are not hardware wallets
wallet_class = self.wallet_class.restore_wallet_class
storage.put('wallet_type', wallet_class.wallet_type)
self.wallet = wallet = wallet_class(storage)
handler = self.create_handler(wizard)
msg = "\n".join([_("Please enter your %s passphrase.") % self.device,
_("Press OK if you do not use one.")])
@@ -147,8 +150,6 @@ class QtPlugin(TrezorPlugin):
wallet.add_seed(seed, password)
wallet.add_cosigner_seed(seed, 'x/', password, passphrase)
wallet.create_main_account(password)
# disable plugin as this is a free-standing wallet
self.set_enabled(False)
return wallet
@hook