Browse Source

lightningd: only initialize plugins once we're ready for them to connect.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
plugin-6
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
1368ac7f3c
  1. 9
      lightningd/lightningd.c

9
lightningd/lightningd.c

@ -616,11 +616,6 @@ int main(int argc, char *argv[])
/*~ Handle options and config; move to .lightningd (--lightning-dir) */
handle_opts(ld, argc, argv);
/*~ Now that we have collected all the early options, gave
* plugins a chance to register theirs and collected all
* remaining options it's time to tell the plugins. */
plugins_config(ld->plugins);
/*~ Make sure we can reach the subdaemons, and versions match. */
test_subdaemons(ld);
@ -715,6 +710,10 @@ int main(int argc, char *argv[])
* over a UNIX domain socket specified by `ld->rpc_filename`. */
jsonrpc_listen(ld->jsonrpc, ld);
/*~ Now that the rpc path exists, we can start the plugins and they
* can start talking to us. */
plugins_config(ld->plugins);
/*~ We defer --daemon until we've completed most initialization: that
* way we'll exit with an error rather than silently exiting 0, then
* realizing we can't start and forcing the confused user to read the

Loading…
Cancel
Save