Browse Source

revert to previous restore method, without daemon

283
ThomasV 9 years ago
parent
commit
142b5532ec
  1. 14
      electrum
  2. 7
      lib/commands.py

14
electrum

@ -147,7 +147,18 @@ def init_cmdline(config):
wallet = Wallet.from_text(text, password, storage) wallet = Wallet.from_text(text, password, storage)
except BaseException as e: except BaseException as e:
sys.exit(str(e)) sys.exit(str(e))
wallet.synchronize() if not config.get('offline'):
network = Network(config)
network.start()
wallet.start_threads(network)
print_msg("Recovering wallet...")
wallet.synchronize()
wallet.restore(lambda x: x)
msg = "Recovery successful" if wallet.is_found() else "Found no history for this wallet"
else:
msg = "This wallet was restored offline. It may contain more addresses than displayed."
print_msg(msg)
else: else:
password = password_dialog() password = password_dialog()
wallet = Wallet(storage) wallet = Wallet(storage)
@ -160,6 +171,7 @@ def init_cmdline(config):
print_msg("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.") print_msg("Please keep it in a safe place; if you lose it, you will not be able to restore your wallet.")
print_msg("Wallet saved in '%s'" % wallet.storage.path) print_msg("Wallet saved in '%s'" % wallet.storage.path)
sys.exit(0)
else: else:
if cmd.requires_wallet and not storage.file_exists: if cmd.requires_wallet and not storage.file_exists:

7
lib/commands.py

@ -101,7 +101,6 @@ class Commands:
@command('') @command('')
def create(self): def create(self):
"""Create a new wallet""" """Create a new wallet"""
return True
@command('wn') @command('wn')
def restore(self, text): def restore(self, text):
@ -109,12 +108,6 @@ class Commands:
public key, a master private key, a list of bitcoin addresses public key, a master private key, a list of bitcoin addresses
or bitcoin private keys. If you want to be prompted for your or bitcoin private keys. If you want to be prompted for your
seed, type '?' or ':' (concealed) """ seed, type '?' or ':' (concealed) """
self.wallet.restore(lambda x: x)
if self.network:
msg = "Recovery successful" if self.wallet.is_found() else "Found no history for this wallet"
else:
msg = "This wallet was restored offline. It may contain more addresses than displayed."
return msg
@command('w') @command('w')
def deseed(self): def deseed(self):

Loading…
Cancel
Save