mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-25 16:54:20 +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:
@@ -336,12 +336,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
check_bitcoind_config(dstate);
|
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. */
|
/* Set up node ID and private key. */
|
||||||
secrets_init(dstate);
|
secrets_init(dstate);
|
||||||
new_node(dstate, &dstate->id);
|
new_node(dstate, &dstate->id);
|
||||||
@@ -349,6 +343,12 @@ int main(int argc, char *argv[])
|
|||||||
/* Initialize block topology. */
|
/* Initialize block topology. */
|
||||||
setup_topology(dstate);
|
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 */
|
/* Make sure we use the artificially-controlled time for timers */
|
||||||
io_time_override(controlled_time);
|
io_time_override(controlled_time);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user