mirror of
https://github.com/ElementsProject/lightning.git
synced 2026-08-18 13:08:13 +02: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
1 changed files with 6 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue