don't try to open window if started in daemon mode
This commit is contained in:
9
electrum
9
electrum
@@ -295,8 +295,11 @@ class ClientThread(util.DaemonThread):
|
|||||||
config = SimpleConfig(config_options)
|
config = SimpleConfig(config_options)
|
||||||
cmd = config.get('cmd')
|
cmd = config.get('cmd')
|
||||||
if cmd == 'gui':
|
if cmd == 'gui':
|
||||||
self.server.gui.new_window(config)
|
if self.server.gui:
|
||||||
response = "ok"
|
self.server.gui.new_window(config)
|
||||||
|
response = "ok"
|
||||||
|
else:
|
||||||
|
response = "Error: Electrum daemon is running"
|
||||||
elif cmd == 'daemon':
|
elif cmd == 'daemon':
|
||||||
sub = config.get('subcommand')
|
sub = config.get('subcommand')
|
||||||
assert sub in ['start', 'stop', 'status']
|
assert sub in ['start', 'stop', 'status']
|
||||||
@@ -340,6 +343,8 @@ class NetworkServer(util.DaemonThread):
|
|||||||
self.lock = threading.RLock()
|
self.lock = threading.RLock()
|
||||||
# each GUI is a client of the daemon
|
# each GUI is a client of the daemon
|
||||||
self.clients = []
|
self.clients = []
|
||||||
|
# gui is None is we run as daemon
|
||||||
|
self.gui = None
|
||||||
|
|
||||||
def add_client(self, client):
|
def add_client(self, client):
|
||||||
for key in ['fee', 'status', 'banner', 'updated', 'servers', 'interfaces']:
|
for key in ['fee', 'status', 'banner', 'updated', 'servers', 'interfaces']:
|
||||||
|
|||||||
Reference in New Issue
Block a user