master: Move JSON-RPC setup below PID-file creation
If we run two daemons on the same directory we'd be getting the failure from trying to listen to the same file before we'd hit the pid-file error, which was causing confusion.
This commit is contained in:
parent
dc88c35d7f
commit
d9ea2e6b45
|
@ -664,10 +664,6 @@ int main(int argc, char *argv[])
|
|||
setup_topology(ld->topology, &ld->timers,
|
||||
min_blockheight, max_blockheight);
|
||||
|
||||
/*~ Create RPC socket: now lightning-cli can send us JSON RPC commands
|
||||
* over a UNIX domain socket specified by `ld->rpc_filename`. */
|
||||
setup_jsonrpc(ld, ld->rpc_filename);
|
||||
|
||||
/*~ 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
|
||||
|
@ -679,6 +675,10 @@ int main(int argc, char *argv[])
|
|||
* changes our pid! */
|
||||
pidfile_create(ld);
|
||||
|
||||
/*~ Create RPC socket: now lightning-cli can send us JSON RPC commands
|
||||
* over a UNIX domain socket specified by `ld->rpc_filename`. */
|
||||
setup_jsonrpc(ld, ld->rpc_filename);
|
||||
|
||||
/*~ Activate connect daemon. Needs to be after the initialization of
|
||||
* chaintopology, otherwise peers may connect and ask for
|
||||
* uninitialized data. */
|
||||
|
|
Loading…
Reference in New Issue