From da65e9e7d5b2d27306e2b1f09b263a0b5e7f343c Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 29 Sep 2016 10:52:51 +0200 Subject: [PATCH] auto-upgrade wallet format --- lib/daemon.py | 3 --- lib/storage.py | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/daemon.py b/lib/daemon.py index 804d2f74f..d85327681 100644 --- a/lib/daemon.py +++ b/lib/daemon.py @@ -187,9 +187,6 @@ class Daemon(DaemonThread): storage = WalletStorage(path) if not storage.file_exists: 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(): return wallet = Wallet(storage) diff --git a/lib/storage.py b/lib/storage.py index 65d3f65c8..f28415dee 100644 --- a/lib/storage.py +++ b/lib/storage.py @@ -60,7 +60,9 @@ class WalletStorage(PrintError): self.print_error("wallet path", self.path) if 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 t = self.get('wallet_type') l = plugin_loaders.get(t)