Browse Source

simplify storage: we don't store pubkeys anymore

283
ThomasV 8 years ago
parent
commit
acd70f55c3
  1. 15
      lib/storage.py

15
lib/storage.py

@ -229,18 +229,8 @@ class WalletStorage(PrintError):
self.convert_imported()
self.convert_wallet_type()
self.convert_account()
self.convert_pubkeys()
self.write()
def convert_pubkeys(self):
# version 12 had a bug in pubkey ordering
# it is fixed by forcing pubkey regeneration
if self.get_seed_version() != 12:
return
if self.get('wallet_type') in ['standard', 'imported']:
return
self.put('pubkeys', {})
def convert_wallet_type(self):
wallet_type = self.get('wallet_type')
if wallet_type == 'btchip': wallet_type = 'ledger'
@ -354,11 +344,8 @@ class WalletStorage(PrintError):
raise BaseException('no addresses or privkeys')
def convert_account(self):
d = self.get('accounts', {}).get('0', {})
if not d:
return False
self.put('accounts', None)
self.put('pubkeys', d)
self.put('pubkeys', None)
def get_action(self):
action = run_hook('get_action', self)

Loading…
Cancel
Save