util.check_windows_wallet_migration()
config = SimpleConfig(config_options)
- storage = WalletStorage(config)
if len(args)==0:
url = None
#sys.exit("Error: Unknown GUI: " + gui_name )
# network interface
- interface = Interface(config, True)
- interface.start(wait = False)
- interface.send([('server.peers.subscribe',[])])
-
- blockchain = BlockchainVerifier(interface, config)
- blockchain.start()
+ network = Network(config)
+ network.start()
- gui = gui.ElectrumGui(config, interface, blockchain)
+ gui = gui.ElectrumGui(config, network)
gui.main(url)
- interface.stop()
- blockchain.stop()
-
+ network.stop()
# we use daemon threads, their termination is enforced.
# this sleep command gives them time to terminate cleanly.
time.sleep(0.1)
# instanciate wallet for command-line
+ storage = WalletStorage(config)
wallet = Wallet(storage)
if cmd not in known_commands:
# open session
if cmd not in offline_commands and not options.offline:
- interface = Interface(config)
- interface.register_callback('connected', lambda: sys.stderr.write("Connected to " + interface.connection_msg + "\n"))
-
- if not interface.start(wait=True):
+ network = Network(config)
+ network.register_callback('connected', lambda: sys.stderr.write("Connected to " + network.interface.connection_msg + "\n"))
+ if not network.start(wait=True):
print_msg("Not connected, aborting.")
sys.exit(1)
- blockchain = BlockchainVerifier(interface, config)
- blockchain.start()
- wallet.start_threads(interface, blockchain)
+
+ wallet.start_threads(network)
wallet.update()
if cmd not in offline_commands and not options.offline:
wallet.stop_threads()
- interface.stop()
- blockchain.stop()
+ network.stop()
time.sleep(0.1)
sys.exit(0)