1
0

fix regression: offline mode

This commit is contained in:
ThomasV
2013-11-05 18:55:53 +01:00
parent 18c2dba9b8
commit b1472ba1a7
5 changed files with 77 additions and 43 deletions

View File

@@ -153,13 +153,18 @@ if __name__ == '__main__':
#sys.exit("Error: Unknown GUI: " + gui_name )
# network interface
network = Network(config)
network.start()
if not options.offline:
network = Network(config)
network.start()
else:
network = None
gui = gui.ElectrumGui(config, network)
gui.main(url)
network.stop()
if network:
network.stop()
# we use daemon threads, their termination is enforced.
# this sleep command gives them time to terminate cleanly.
time.sleep(0.1)
@@ -215,17 +220,22 @@ if __name__ == '__main__':
wallet.init_seed( str(seed) )
wallet.save_seed()
network = Network(config)
network.start()
wallet.start_threads(network)
if not options.offline:
network = Network(config)
network.start()
wallet.start_threads(network)
print_msg("Recovering wallet...")
wallet.restore(lambda x: x)
print_msg("Recovering wallet...")
wallet.restore(lambda x: x)
if wallet.is_found():
print_msg("Recovery successful")
if wallet.is_found():
print_msg("Recovery successful")
else:
print_msg("Warning: Found no history for this wallet")
else:
print_msg("Warning: Found no history for this wallet")
wallet.create_accounts()
wallet.synchronize()
print_msg("Warning: This wallet was restored offline. It may contain more addresses than displayed.")
else:
wallet.init_seed(None)