fix restore from mpk command line

This commit is contained in:
ThomasV 2014-09-08 05:17:56 +02:00
parent ea9e468333
commit bd6f21232d
2 changed files with 8 additions and 6 deletions

View File

@ -283,7 +283,10 @@ if __name__ == '__main__':
if cmd.name == 'restore':
if options.mpk:
wallet = Wallet.from_mpk(options.mpk, storage)
if Wallet.is_old_mpk(options.mpk):
wallet = Wallet.from_old_mpk(options.mpk, storage)
if Wallet.is_xpub(options.mpk):
wallet = Wallet.from_xpub(options.mpk, storage)
else:
import getpass
seed = getpass.getpass(prompt="seed:", stream=None) if options.concealed else raw_input("seed:")
@ -295,7 +298,8 @@ if __name__ == '__main__':
wallet.create_main_account(password)
if not options.offline:
network = Network(config)
s = get_daemon(config, True)
network = NetworkProxy(s,config)
network.start()
wallet.start_threads(network)
print_msg("Recovering wallet...")

View File

@ -1191,12 +1191,10 @@ class Deterministic_Wallet(Abstract_Wallet):
def wait_for_wallet():
self.set_up_to_date(False)
while not self.is_up_to_date():
msg = "%s\n%s %d\n%s %.1f"%(
msg = "%s\n%s %d"%(
_("Please wait..."),
_("Addresses generated:"),
len(self.addresses(True)),
_("Kilobytes received:"),
self.network.interface.bytes_received/1024.)
len(self.addresses(True)))
apply(callback, (msg,))
time.sleep(0.1)