Browse Source

check seed_version first

283 seed_v9
ThomasV 10 years ago
parent
commit
1df007483e
  1. 20
      lib/wallet.py

20
lib/wallet.py

@ -1607,16 +1607,6 @@ class Wallet(object):
def __new__(self, storage):
run_hook('add_wallet_types', wallet_types)
wallet_type = storage.get('wallet_type')
if wallet_type:
for cat, t, name, c in wallet_types:
if t == wallet_type:
WalletClass = c
break
else:
raise BaseException('unknown wallet type', wallet_type)
else:
seed_version = storage.get('seed_version')
if not seed_version:
seed_version = OLD_SEED_VERSION if len(storage.get('master_public_key','')) == 128 else NEW_SEED_VERSION
@ -1628,6 +1618,16 @@ class Wallet(object):
print msg
sys.exit(1)
run_hook('add_wallet_types', wallet_types)
wallet_type = storage.get('wallet_type')
if wallet_type:
for cat, t, name, c in wallet_types:
if t == wallet_type:
WalletClass = c
break
else:
raise BaseException('unknown wallet type', wallet_type)
else:
if seed_version == OLD_SEED_VERSION:
WalletClass = OldWallet
else:

Loading…
Cancel
Save