Reimplement RPC server and client
[novacoin.git] / src / init.cpp
index 0801311..0a70532 100644 (file)
@@ -89,6 +89,7 @@ void Shutdown(void* parg)
         nTransactionsUpdated++;
 //        CTxDB().Close();
         bitdb.Flush(false);
+        StopRPCServer();
         StopNode();
         bitdb.Flush(true);
         boost::filesystem::remove(GetPidFile());
@@ -994,7 +995,7 @@ bool AppInit2()
         InitError(_("Error: could not start node"));
 
     if (fServer)
-        NewThread(ThreadRPCServer, NULL);
+        StartRPCServer();
 
     // ********************************************************* Step 13: IP collection thread
     strCollectorCommand = GetArg("-peercollector", "");