Rename fNoListen to fListen
[novacoin.git] / src / init.cpp
index 4b64d35..e645b99 100644 (file)
@@ -642,12 +642,6 @@ bool AppInit2()
                 SetLimited(net);
         }
     }
-#if defined(USE_IPV6)
-#if ! USE_IPV6
-    else
-        SetLimited(NET_IPV6);
-#endif
-#endif
 
     CService addrProxy;
     bool fProxy = false;
@@ -658,10 +652,8 @@ bool AppInit2()
 
         if (!IsLimited(NET_IPV4))
             SetProxy(NET_IPV4, addrProxy);
-#ifdef USE_IPV6
             if (!IsLimited(NET_IPV6))
                 SetProxy(NET_IPV6, addrProxy);
-#endif
             SetNameProxy(addrProxy);
         fProxy = true;
     }
@@ -682,19 +674,19 @@ bool AppInit2()
     // see Step 2: parameter interactions for more information about these
     if (!IsLimited(NET_IPV4) || !IsLimited(NET_IPV6))
     {
-        fNoListen = !GetBoolArg("-listen", true);
+        fListen = GetBoolArg("-listen", true);
         fDiscover = GetBoolArg("-discover", true);
         fNameLookup = GetBoolArg("-dns", true);
     } else {
         // Don't listen, discover addresses or search for nodes if IPv4 and IPv6 networking is disabled.
-        fNoListen = true;
+        fListen = false;
         fDiscover = fNameLookup = false;
         SoftSetBoolArg("-irc", false);
         SoftSetBoolArg("-dnsseed", false);
     }
 
     bool fBound = false;
-    if (!fNoListen)
+    if (fListen)
     {
         if (mapArgs.count("-bind")) {
             for(std::string strBind :  mapMultiArgs["-bind"]) {
@@ -706,10 +698,8 @@ bool AppInit2()
         } else {
             struct in_addr inaddr_any;
             inaddr_any.s_addr = INADDR_ANY;
-#ifdef USE_IPV6
             if (!IsLimited(NET_IPV6))
                 fBound |= Bind(CService(in6addr_any, GetListenPort()), false);
-#endif
             if (!IsLimited(NET_IPV4))
                 fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound);
 
@@ -725,10 +715,8 @@ bool AppInit2()
         struct in_addr inaddr_loopback;
         inaddr_loopback.s_addr = htonl(INADDR_LOOPBACK);
 
-#ifdef USE_IPV6
         if (!BindListenPort(CService(in6addr_loopback, GetListenPort()), strError))
             return InitError(strError);
-#endif
         if (!BindListenPort(CService(inaddr_loopback, GetListenPort()), strError))
             return InitError(strError);
     }