check seed_version first
This commit is contained in:
parent
5c5bb6ae3a
commit
1df007483e
|
@ -1607,6 +1607,17 @@ class Wallet(object):
|
||||||
|
|
||||||
def __new__(self, storage):
|
def __new__(self, storage):
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
if seed_version not in [OLD_SEED_VERSION, NEW_SEED_VERSION]:
|
||||||
|
msg = "This wallet seed is not supported anymore."
|
||||||
|
if seed_version in [5, 7, 8]:
|
||||||
|
msg += "\nTo open this wallet, try 'git checkout seed_v%d'"%seed_version
|
||||||
|
print msg
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
run_hook('add_wallet_types', wallet_types)
|
run_hook('add_wallet_types', wallet_types)
|
||||||
wallet_type = storage.get('wallet_type')
|
wallet_type = storage.get('wallet_type')
|
||||||
if wallet_type:
|
if wallet_type:
|
||||||
|
@ -1617,17 +1628,6 @@ class Wallet(object):
|
||||||
else:
|
else:
|
||||||
raise BaseException('unknown wallet type', wallet_type)
|
raise BaseException('unknown wallet type', wallet_type)
|
||||||
else:
|
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
|
|
||||||
|
|
||||||
if seed_version not in [OLD_SEED_VERSION, NEW_SEED_VERSION]:
|
|
||||||
msg = "This wallet seed is not supported anymore."
|
|
||||||
if seed_version in [5, 7, 8]:
|
|
||||||
msg += "\nTo open this wallet, try 'git checkout seed_v%d'"%seed_version
|
|
||||||
print msg
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if seed_version == OLD_SEED_VERSION:
|
if seed_version == OLD_SEED_VERSION:
|
||||||
WalletClass = OldWallet
|
WalletClass = OldWallet
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue