1
0

Convert legacy restored hardware wallets

Hardware wallets do not have a seed and hardware wallet
code should not have to worry about that case.
This commit is contained in:
Neil Booth
2015-12-31 09:51:27 +09:00
parent 19f527c717
commit f263f8b0fd
2 changed files with 15 additions and 2 deletions

View File

@@ -1932,7 +1932,18 @@ class Wallet(object):
else:
WalletClass = NewWallet
return WalletClass(storage)
wallet = WalletClass(storage)
# Convert hardware wallets restored with older versions of
# Electrum to BIP44 wallets. A hardware wallet does not have
# a seed and plugins do not need to handle having one.
rwc = getattr(wallet, 'restore_wallet_class', None)
if rwc and storage.get('seed', ''):
storage.print_error("converting wallet type to " + rwc.wallet_type)
storage.put('wallet_type', rwc.wallet_type)
wallet = rwc(storage)
return wallet
@classmethod
def is_seed(self, seed):