Browse Source

auto-upgrade wallet format

283
ThomasV 8 years ago
parent
commit
da65e9e7d5
  1. 3
      lib/daemon.py
  2. 4
      lib/storage.py

3
lib/daemon.py

@ -187,9 +187,6 @@ class Daemon(DaemonThread):
storage = WalletStorage(path) storage = WalletStorage(path)
if not storage.file_exists: if not storage.file_exists:
return return
if storage.requires_upgrade() and 'ANDROID_DATA' in os.environ:
self.print_error('upgrading wallet format')
storage.upgrade()
if storage.requires_split() or storage.requires_upgrade() or storage.get_action(): if storage.requires_split() or storage.requires_upgrade() or storage.get_action():
return return
wallet = Wallet(storage) wallet = Wallet(storage)

4
lib/storage.py

@ -60,7 +60,9 @@ class WalletStorage(PrintError):
self.print_error("wallet path", self.path) self.print_error("wallet path", self.path)
if self.path: if self.path:
self.read(self.path) self.read(self.path)
if self.requires_upgrade():
self.print_error('upgrading wallet format')
self.upgrade()
# check here if I need to load a plugin # check here if I need to load a plugin
t = self.get('wallet_type') t = self.get('wallet_type')
l = plugin_loaders.get(t) l = plugin_loaders.get(t)

Loading…
Cancel
Save