mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
lightningd: only initialize plugins once we're ready for them to connect.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
d7e233e47d
commit
1368ac7f3c
@ -616,11 +616,6 @@ int main(int argc, char *argv[])
|
|||||||
/*~ Handle options and config; move to .lightningd (--lightning-dir) */
|
/*~ Handle options and config; move to .lightningd (--lightning-dir) */
|
||||||
handle_opts(ld, argc, argv);
|
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. */
|
/*~ Make sure we can reach the subdaemons, and versions match. */
|
||||||
test_subdaemons(ld);
|
test_subdaemons(ld);
|
||||||
|
|
||||||
@ -715,6 +710,10 @@ int main(int argc, char *argv[])
|
|||||||
* over a UNIX domain socket specified by `ld->rpc_filename`. */
|
* over a UNIX domain socket specified by `ld->rpc_filename`. */
|
||||||
jsonrpc_listen(ld->jsonrpc, ld);
|
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
|
/*~ We defer --daemon until we've completed most initialization: that
|
||||||
* way we'll exit with an error rather than silently exiting 0, then
|
* 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
|
* realizing we can't start and forcing the confused user to read the
|
||||||
|
Loading…
Reference in New Issue
Block a user