From 7c702b518d7188d3ca5ccbb68d35a913d3ab061a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sun, 7 Jan 2018 16:13:56 +0100 Subject: [PATCH] disable jsonrpc on android --- electrum | 4 ++-- lib/daemon.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/electrum b/electrum index 1c21e234e..e40d58026 100755 --- a/electrum +++ b/electrum @@ -372,7 +372,7 @@ if __name__ == '__main__': fd, server = daemon.get_fd_or_server(config) if fd is not None: plugins = init_plugins(config, config.get('gui', 'qt')) - d = daemon.Daemon(config, fd) + d = daemon.Daemon(config, fd, is_android) d.start() d.init_gui(config, plugins) sys.exit(0) @@ -393,7 +393,7 @@ if __name__ == '__main__': print_stderr("starting daemon (PID %d)" % pid) sys.exit(0) init_plugins(config, 'cmdline') - d = daemon.Daemon(config, fd) + d = daemon.Daemon(config, fd, is_android) d.start() if config.get('websocket_server'): from electrum import websockets diff --git a/lib/daemon.py b/lib/daemon.py index d80f130d4..3c3c04f3d 100644 --- a/lib/daemon.py +++ b/lib/daemon.py @@ -89,7 +89,7 @@ def get_server(config): class Daemon(DaemonThread): - def __init__(self, config, fd): + def __init__(self, config, fd, is_android): DaemonThread.__init__(self) self.config = config if config.get('offline'): @@ -103,9 +103,12 @@ class Daemon(DaemonThread): self.gui = None self.wallets = {} - # Setup JSONRPC server - self.cmd_runner = Commands(self.config, None, self.network) - self.init_server(config, fd) + if not is_android: + # Setup JSONRPC server + self.cmd_runner = Commands(self.config, None, self.network) + self.init_server(config, fd) + else: + self.server = None def init_server(self, config, fd): host = config.get('rpchost', '127.0.0.1')