diff --git a/daemon/lightningd.c b/daemon/lightningd.c index 085310418..3c43a070a 100644 --- a/daemon/lightningd.c +++ b/daemon/lightningd.c @@ -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);