electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 49a4c6c92a2ff8526a03f04e6c155d44f7a828ff
parent d848e9b91d318343270016a673de33c9267b2f1c
Author: ecdsa <ecdsa@github>
Date:   Sun, 10 Mar 2013 10:15:09 +0100

do not wait for interface when launching gui

Diffstat:
Melectrum | 13++++++++++---
Mlib/interface.py | 5-----
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/electrum b/electrum @@ -125,8 +125,7 @@ if __name__ == '__main__': interface = Interface(config, True) wallet.interface = interface interface.start() - if interface.is_connected: - interface.send([('server.peers.subscribe',[])]) + interface.send([('server.peers.subscribe',[])]) gui = gui.ElectrumGui(wallet, config) @@ -241,8 +240,11 @@ if __name__ == '__main__': if not options.offline: interface = Interface(config) interface.start() + interface.connect_event.wait() + if not interface.is_connected: + print_msg("Not connected, aborting.") + sys.exit(1) wallet.interface = interface - verifier = WalletVerifier(interface, config) wallet.set_verifier(verifier) @@ -359,6 +361,11 @@ if __name__ == '__main__': interface = Interface(config) interface.register_callback('connected', lambda: sys.stderr.write("Connected to " + interface.connection_msg + "\n")) interface.start() + # wait until connected + interface.connect_event.wait() + if not interface.is_connected: + print_msg("Not connected, aborting.") + sys.exit(1) wallet.interface = interface verifier = WalletVerifier(interface, config) wallet.set_verifier(verifier) diff --git a/lib/interface.py b/lib/interface.py @@ -586,11 +586,6 @@ class Interface(threading.Thread): return out - def start(self): - threading.Thread.start(self) - # wait until connection is established - self.connect_event.wait() - def run(self): while True: self.init_interface()