From a40ab012108ad7ba11c412d52d7a0347600584ae Mon Sep 17 00:00:00 2001 From: SomberNight Date: Fri, 27 Oct 2017 16:06:36 +0200 Subject: [PATCH] seed_version: separate methods for v14 and v15 conversion (storage) --- lib/storage.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/storage.py b/lib/storage.py index e29e5b2aa..ee7dec0b9 100644 --- a/lib/storage.py +++ b/lib/storage.py @@ -258,6 +258,7 @@ class WalletStorage(PrintError): self.convert_wallet_type() self.convert_account() self.convert_version_13_b() + self.convert_version_14() self.convert_version_15() self.put('seed_version', FINAL_SEED_VERSION) # just to be sure @@ -373,7 +374,7 @@ class WalletStorage(PrintError): self.put('seed_version', 13) - def convert_version_15(self): + def convert_version_14(self): # convert imported wallets for 3.0 if not self._is_upgrade_method_needed(13, 13): return @@ -400,6 +401,12 @@ class WalletStorage(PrintError): self.put('addresses', d) self.put('pubkeys', None) self.put('wallet_type', 'imported') + self.put('seed_version', 14) + + def convert_version_15(self): + if not self._is_upgrade_method_needed(14, 14): + return + assert self.get('seed_type') != 'segwit' # unsupported derivation self.put('seed_version', 15) def convert_imported(self):