commit 3382354442c2a9729301dadd8070ed563b2b5b54
parent 29a8c0f0e6e2af55c4913bfddea755637775b154
Author: ecdsa <ecdsa@github>
Date: Thu, 7 Mar 2013 16:41:43 +0100
fix: restore wallet from master public key
Diffstat:
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/electrum b/electrum
@@ -148,7 +148,7 @@ if __name__ == '__main__':
wallet.gap_limit = gap
if len(seed) == 128:
wallet.seed = ''
- wallet.sequence.master_public_key = seed
+ wallet.init_sequence(str(seed))
else:
wallet.init_seed(str(seed))
diff --git a/gui/gui_classic.py b/gui/gui_classic.py
@@ -2315,7 +2315,8 @@ class ElectrumGui:
def password_dialog(self):
- ElectrumWindow.change_password_dialog(self.wallet)
+ if self.wallet.seed:
+ ElectrumWindow.change_password_dialog(self.wallet)
def restore_wallet(self):
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -161,16 +161,17 @@ class Wallet:
self.seed = seed
self.config.set_key('seed', self.seed, True)
self.config.set_key('seed_version', self.seed_version, True)
-
mpk = ElectrumSequence.mpk_from_seed(self.seed)
+ self.init_sequence(mpk)
+
+
+ def init_sequence(self, mpk):
self.config.set_key('master_public_key', mpk, True)
self.sequences[0] = ElectrumSequence(mpk)
-
self.accounts[0] = { 0:[], 1:[], 'name':'Main account' }
self.config.set_key('accounts', self.accounts, True)
-
def addresses(self, include_change = False):
o = self.imported_keys.keys()
for a in self.accounts.values():