electrum

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

commit 3c11c632899da3b4c6a3d56e58fb4894693f4048
parent a4c767437c3df0db924d86fb12d98fc8b0a39054
Author: ThomasV <thomasv@electrum.org>
Date:   Mon, 30 Nov 2015 10:23:38 +0100

fix daemon: don't oad wallet if there is a gui

Diffstat:
Melectrum | 6+++---
Mlib/daemon.py | 12++++++++----
2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/electrum b/electrum @@ -356,10 +356,10 @@ if __name__ == '__main__': network.start() else: network = None - server = Daemon(config, network) + gui = init_gui(config, network, plugins) + server = Daemon(config, network, gui) server.start() - server.gui = init_gui(config, network, plugins) - server.gui.main() + gui.main() server.stop() sys.exit(0) diff --git a/lib/daemon.py b/lib/daemon.py @@ -56,12 +56,16 @@ class RequestHandler(SimpleJSONRPCRequestHandler): class Daemon(util.DaemonThread): - def __init__(self, config, network): + def __init__(self, config, network, gui=None): util.DaemonThread.__init__(self) self.config = config self.network = network + self.gui = gui self.wallets = {} - self.wallet = self.load_wallet(config) + if gui is None: + self.wallet = self.load_wallet(config) + else: + self.wallet = None self.cmd_runner = Commands(self.config, self.wallet, self.network) host = config.get('rpchost', 'localhost') port = config.get('rpcport', 7777) @@ -72,7 +76,7 @@ class Daemon(util.DaemonThread): self.server.register_function(self.run_cmdline, 'run_cmdline') self.server.register_function(self.ping, 'ping') self.server.register_function(self.daemon, 'daemon') - self.server.register_function(self.gui, 'gui') + self.server.register_function(self.run_gui, 'gui') def ping(self): return True @@ -99,7 +103,7 @@ class Daemon(util.DaemonThread): response = "Daemon stopped" return response - def gui(self, config_options): + def run_gui(self, config_options): config = SimpleConfig(config_options) if self.gui: if hasattr(self.gui, 'new_window'):