mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
lightningd: don't create rpc socket & listening socket until topology known.
We can deref a NULL tip pointer otherwise. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
35f83841da
commit
4563ff91e9
@ -336,12 +336,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
check_bitcoind_config(dstate);
|
||||
|
||||
/* Create RPC socket (if any) */
|
||||
setup_jsonrpc(dstate, dstate->rpc_filename);
|
||||
|
||||
/* Set up connections from peers. */
|
||||
setup_listeners(dstate, portnum);
|
||||
|
||||
/* Set up node ID and private key. */
|
||||
secrets_init(dstate);
|
||||
new_node(dstate, &dstate->id);
|
||||
@ -349,6 +343,12 @@ int main(int argc, char *argv[])
|
||||
/* Initialize block topology. */
|
||||
setup_topology(dstate);
|
||||
|
||||
/* Create RPC socket (if any) */
|
||||
setup_jsonrpc(dstate, dstate->rpc_filename);
|
||||
|
||||
/* Set up connections from peers. */
|
||||
setup_listeners(dstate, portnum);
|
||||
|
||||
/* Make sure we use the artificially-controlled time for timers */
|
||||
io_time_override(controlled_time);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user