revert to previous restore method, without daemon

This commit is contained in:
ThomasV 2015-10-28 11:11:41 +01:00
parent ca9eb50821
commit 142b5532ec
2 changed files with 13 additions and 8 deletions

View File

@ -147,7 +147,18 @@ def init_cmdline(config):
wallet = Wallet.from_text(text, password, storage)
except BaseException as 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:
password = password_dialog()
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("Wallet saved in '%s'" % wallet.storage.path)
sys.exit(0)
else:
if cmd.requires_wallet and not storage.file_exists:

View File

@ -101,7 +101,6 @@ class Commands:
@command('')
def create(self):
"""Create a new wallet"""
return True
@command('wn')
def restore(self, text):
@ -109,12 +108,6 @@ class Commands:
public key, a master private key, a list of bitcoin addresses
or bitcoin private keys. If you want to be prompted for your
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')
def deseed(self):