Browse Source

fix: restore wallet from master public key

283
ecdsa 12 years ago
parent
commit
3382354442
  1. 2
      electrum
  2. 3
      gui/gui_classic.py
  3. 7
      lib/wallet.py

2
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))

3
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):

7
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():

Loading…
Cancel
Save