tdon't try to open window if started in daemon mode - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 0e2db1e0caa774bdb5ebf811ecab7b0d700fda9c DIR parent 0fa38074deea8ab4e07c9b948f0fea8a21dfae29 HTML Author: ThomasV <thomasv@gitorious> Date: Tue, 1 Sep 2015 10:17:55 +0200 don't try to open window if started in daemon mode Diffstat: M electrum | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- DIR diff --git a/electrum b/electrum t@@ -295,8 +295,11 @@ class ClientThread(util.DaemonThread): config = SimpleConfig(config_options) cmd = config.get('cmd') if cmd == 'gui': - self.server.gui.new_window(config) - response = "ok" + if self.server.gui: + self.server.gui.new_window(config) + response = "ok" + else: + response = "Error: Electrum daemon is running" elif cmd == 'daemon': sub = config.get('subcommand') assert sub in ['start', 'stop', 'status'] t@@ -340,6 +343,8 @@ class NetworkServer(util.DaemonThread): self.lock = threading.RLock() # each GUI is a client of the daemon self.clients = [] + # gui is None is we run as daemon + self.gui = None def add_client(self, client): for key in ['fee', 'status', 'banner', 'updated', 'servers', 'interfaces']: