Commit Graph

84 Commits

Author SHA1 Message Date
ThomasV 305843999e Relicensing 2016-02-24 10:20:30 +01:00
ThomasV ddc1869551 disambiguate types returned by get_fd_or_server 2016-02-01 13:10:01 +01:00
ThomasV 690c862923 move static methods away from daemon class; restore initial logic 2016-02-01 10:20:22 +01:00
ThomasV 3b00f62d46 remove another unnecessary static method 2016-02-01 09:25:57 +01:00
ThomasV 1c83c3e060 do not declare pointless static methods 2016-02-01 09:12:53 +01:00
ThomasV 56c7d4139e fix: Daemon.get_server 2016-02-01 09:02:57 +01:00
Neil Booth abaf1bc6dc daemon: remove two unneeded member vars 2016-01-31 18:03:50 +09:00
Neil Booth a90c935758 Remove unreachable code 2016-01-31 14:53:25 +09:00
Neil Booth 788ab520ea Remove dead code from prior 2016-01-31 14:48:57 +09:00
Neil Booth e6020975a5 daemon: prevent races by opening with O_EXCL
Rework the way the daemon and server are created.  If we might
want to create a daemon, try to grab the lockfile with O_EXCL.
If we got it, create a server and daemon, otherwise try and
connect to the server.  If connecting to the server fails (including
after sleeping a little in case the server was recently created),
remove the lockfile and start over.

Other fix: shut down network gracefully on daemon exit.

Fixes #1638
2016-01-31 14:46:03 +09:00
Neil Booth f91f03b3d4 daemon: fix long-standing bug in status request
Gracefully handle a status request when self.network is None
2016-01-31 11:50:44 +09:00
Neil Booth ec24087b5a Move some logic from electrum to daemon
Ultimate goal is to try and stop the daemon race at startup.
Need to isolate logic of checking for server and creating one.
2016-01-31 11:43:11 +09:00
Neil Booth f6f7113978 daemon: create network inside constructor 2016-01-31 10:58:27 +09:00
ThomasV ed401761f1 sorry, confused
This reverts commit 5e6a55edd5.
2016-01-30 11:24:53 +01:00
ThomasV 5e6a55edd5 Revert "Revert "Daemon network cleanup""
This reverts commit 2c7b10a776.
2016-01-30 11:13:11 +01:00
ThomasV 2c7b10a776 Revert "Daemon network cleanup"
This reverts commit 0a1b3eac9c.
2016-01-29 17:37:56 +01:00
Neil Booth 0a1b3eac9c Daemon network cleanup
All Daemon creation was preceded by Network creation, based on
config, and passing it to Daemon.
As config is passed to Daemon, it might as well create its own
network and the code is in one place.
2016-01-29 22:14:50 +09:00
ThomasV 388ed01d0f fix start_threads in wizard 2016-01-13 15:02:58 +01:00
ThomasV 2f6e2ebcd2 test if wizard is needed in daemon 2016-01-13 14:30:09 +01:00
Neil Booth 4c9b224d4c Put open_wallet back as class method. 2016-01-13 20:56:44 +09:00
ThomasV ef1f649d58 fix missing parameter 2016-01-13 11:31:23 +01:00
ThomasV 632905dfbe instantiate wizard only if needed 2016-01-13 11:27:17 +01:00
ThomasV 62868ab29a Register loaded wallets in daemon, to prevent a wallet from being opened twice.
Simplify the wizard logic.
2016-01-06 00:58:43 +01:00
ThomasV acbe67fd1f separation between RPC and non-RPC commands. 2015-12-23 10:54:31 +01:00
ThomasV 3bed2e3106 don't wait for wallet sync in rpc commands; instead, show wallet status in status command 2015-12-17 17:54:49 +01:00
ThomasV 6770834d06 daemon: use available port 2015-12-08 10:55:34 +01:00
ThomasV becfe13df2 decrease daemon timeout 2015-12-07 18:42:12 +01:00
Neil Booth 50dcee69d0 Clean up imports in daemon.py 2015-12-05 21:38:20 +09:00
Neil Booth 03b4868bf8 Handle JSON RPC server timeouts differently
Prior method was causing issues on Python 2.7.10 on DragonFlyBSD at
least.
2015-12-05 21:30:37 +09:00
ThomasV 95393656aa rename command: notify 2015-12-01 08:58:00 +01:00
ThomasV 3c11c63289 fix daemon: don't oad wallet if there is a gui 2015-11-30 10:23:38 +01:00
ThomasV 4682d95a76 merge jsonrpc gui and daemon 2015-11-30 10:09:54 +01:00
ThomasV 92e0744470 Refactoring of daemon:
* gui and daemon are in the same process
 * commands that require network are sent to the daemon
 * open only one gui window per wallet
2015-08-30 11:31:51 +02:00
ThomasV 713fa00d86 fix estimatefee for daemon 2015-08-07 10:54:32 +02:00
ThomasV e9f5e6866d check www dir on daemon start 2015-07-25 12:25:47 +02:00
ThomasV 18d145cced add websocket to webpages 2015-07-24 11:39:12 +02:00
Neil Booth 3a50c78a47 Avoid string representation issues
Caused by unicode vs non-unicode strings.
Fixes #1338
2015-07-03 13:53:15 +09:00
ThomasV 117b809bab fix issue #1238 2015-05-24 16:14:56 +02:00
ThomasV 5bd22d2378 follow-up to bd781d600b8ce2bc9dcebebbdb0fb60ad2fb892e: use pipe 2015-05-21 12:50:26 +02:00
Neil Booth bd781d600b Have queues passed to the network constructor.
This is somewhat cleaner as the proxy's pipe and network setup
was awkwardly interleaved.  It also means network's constructor
is free to use both; currently some code is working around the
fact that the response queue doesn't exist in the constructor.
2015-05-21 12:49:39 +09:00
ThomasV a0e9046c2c prepare for 2.2 release 2015-05-17 09:17:52 +02:00
ThomasV e33bc2473b network: don't store unanswered request if result is in cache 2015-05-17 09:00:36 +02:00
ThomasV 50bc50d78d daemon: filter notificaions sent to client 2015-04-20 09:16:43 +02:00
ThomasV 5f29017c9d pass config.path to daemon (exemptore). fixes #901 2015-04-02 12:12:18 +02:00
ThomasV 0200778ac1 require user to start daemon explicitly 2015-03-23 11:50:13 +01:00
ThomasV b93aa9bc43 do not display daemon socket path 2015-03-14 19:08:22 +01:00
ThomasV 72688a5cfa clean implementation of daemon threads 2015-03-13 23:04:29 +01:00
ThomasV 4780d8f811 do not try to connect to daemon on windows (af_unix) 2015-03-09 09:35:10 +01:00
ThomasV 59c76f5e09 use file socket for daemon 2015-03-05 07:16:48 +01:00
Tafelpoot 6557c4b9df daemon fix on windows more compact 2014-11-28 17:08:40 +01:00