From c7f667e2edec8d18ac6d6b0f664d833704b61977 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 29 Aug 2014 14:11:59 +0200 Subject: [PATCH] separate add_seed from create_master_keys --- electrum | 2 ++ gui/gtk.py | 6 ++++-- gui/qt/installwizard.py | 4 ++++ lib/wallet.py | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/electrum b/electrum index 1ab603ac..cfa401bc 100755 --- a/electrum +++ b/electrum @@ -289,6 +289,7 @@ if __name__ == '__main__': sys.exit("Error: Invalid seed") wallet = Wallet.from_seed(seed, storage) wallet.add_seed(seed, password) + wallet.create_master_keys(password) wallet.create_main_account(password) if not options.offline: @@ -310,6 +311,7 @@ if __name__ == '__main__': wallet = Wallet(storage) seed = wallet.make_seed() wallet.add_seed(seed, password) + wallet.create_master_keys(password) wallet.create_main_account(password) wallet.synchronize() print_msg("Your wallet generation seed is:\n\"%s\"" % seed) diff --git a/gui/gtk.py b/gui/gtk.py index 8cccf775..951c16e6 100644 --- a/gui/gtk.py +++ b/gui/gtk.py @@ -1304,7 +1304,8 @@ class ElectrumGui(): r = change_password_dialog(False, None) password = r[2] if r else None wallet.add_seed(seed, password) - wallet.create_accounts(password) + wallet.create_master_keys(password) + wallet.create_main_account(password) wallet.synchronize() # generate first addresses offline elif action == 'restore': @@ -1314,7 +1315,8 @@ class ElectrumGui(): r = change_password_dialog(False, None) password = r[2] if r else None wallet.add_seed(seed, password) - wallet.create_accounts(password) + wallet.create_master_keys(password) + wallet.create_main_account(password) else: exit() diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py index ddb4a917..823b054a 100644 --- a/gui/qt/installwizard.py +++ b/gui/qt/installwizard.py @@ -380,6 +380,7 @@ class InstallWizard(QDialog): return password = self.password_dialog() wallet.add_seed(seed, password) + wallet.create_master_keys(password) elif action == 'add_cosigner': xpub1 = wallet.master_public_keys.get("x1/") @@ -464,6 +465,7 @@ class InstallWizard(QDialog): password = self.password_dialog() wallet = Wallet.from_seed(text, self.storage) wallet.add_seed(text, password) + wallet.create_master_keys(password) wallet.create_main_account(password) else: raise BaseException('unknown wallet type') @@ -486,6 +488,7 @@ class InstallWizard(QDialog): if Wallet.is_seed(text1): wallet.add_seed(text1, password) + wallet.create_master_keys(password) else: wallet.add_master_public_key("x1/", text1) @@ -520,6 +523,7 @@ class InstallWizard(QDialog): if Wallet.is_seed(text1): wallet.add_seed(text1, password) + wallet.create_master_keys(password) else: wallet.add_master_public_key("x1/", text1) diff --git a/lib/wallet.py b/lib/wallet.py index 7d485675..329d2e73 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1071,7 +1071,6 @@ class Deterministic_Wallet(Abstract_Wallet): self.storage.put('seed', self.seed, True) self.storage.put('seed_version', self.seed_version, True) self.storage.put('use_encryption', self.use_encryption,True) - self.create_master_keys(password) def get_seed(self, password): return pw_decode(self.seed, password)