Merge pull request #355 from svost/c++11
[novacoin.git] / src / ipcollector.cpp
index 30014fd..b108b37 100644 (file)
@@ -1,15 +1,15 @@
-#include <string>
-#include <iostream>
-#include <cstdio>
-
-#include "net.h"
+// Copyright (c) 2012-2016 The Novacoin developers
+// Distributed under the MIT/X11 software license, see the accompanying
+// file COPYING or https://opensource.org/licenses/mit-license.php.
 
 #ifdef WIN32
+#include <winsock2.h>
 #define popen    _popen
 #define pclose   _pclose
-#else
 #endif
 
+#include "net.h"
+
 std::string strCollectorCommand;
 
 std::string exec(const char* cmd) {
@@ -27,7 +27,7 @@ std::string exec(const char* cmd) {
 
 bool AddPeer(std::string &strIpAddr) {
     LOCK(cs_vAddedNodes);
-    std::vector<std::string>::iterator it = vAddedNodes.begin();
+    auto it = vAddedNodes.begin();
     for(; it != vAddedNodes.end(); it++) {
         if (strIpAddr == *it) break;
     }
@@ -61,7 +61,7 @@ void ThreadIPCollector(void* parg) {
         strExecutableFilePath = strCollectorCommand;
 #endif
 
-    if (strExecutableFilePath != "")
+    if (!strExecutableFilePath.empty())
     {
         while(!fShutdown) {
             if (fServer) {