more log_init and rpc_init after dnet fork a new process.
@@ -71,9 +71,6 @@ int xdag_init(int argc, char **argv, int isGui)
printf("%s client/server, version %s.\n", g_progname, XDAG_VERSION);
}
- /* initialize log system */
- if (xdag_log_init()) return -1;
-
g_xdag_run = 1;
xdag_show_state(0);
@@ -162,9 +159,6 @@ int xdag_init(int argc, char **argv, int isGui)
g_xdag_pool = is_pool; // move to here to avoid Data Race
- /* initialize json rpc */
- if(is_rpc && xdag_rpc_service_init(rpc_port)) return -1;
-
g_is_miner = is_miner;
g_is_pool = is_pool;
if (pubaddr && !bindto) {
@@ -184,6 +178,12 @@ int xdag_init(int argc, char **argv, int isGui)
printf("Transport module: ");
if (xdag_transport_start(transport_flags, bindto, n_addrports, addrports)) return -1;
+ /* initialize log system */
+ if (xdag_log_init()) return -1;
+
+ /* initialize json rpc */
+ if(is_rpc && xdag_rpc_service_init(rpc_port)) return -1;
+
if (!is_miner) {
xdag_mess("Reading hosts database...");
if (xdag_netdb_init(pubaddr, n_addrports, addrports)) return -1;
