Code cleanup 336/head
authorsvost <ya.nowa@yandex.ru>
Sat, 30 Apr 2016 20:05:25 +0000 (23:05 +0300)
committersvost <ya.nowa@yandex.ru>
Sat, 30 Apr 2016 20:05:25 +0000 (23:05 +0300)
src/init.cpp
src/net.h
src/netbase.cpp
src/netbase.h
src/qt/optionsmodel.cpp

index 13f1916..6689169 100644 (file)
@@ -708,7 +708,6 @@ bool AppInit2()
     bool fBound = false;
     if (!fNoListen)
     {
-        std::string strError;
         if (mapArgs.count("-bind")) {
             for(std::string strBind :  mapMultiArgs["-bind"]) {
                 CService addrBind;
index 4032d10..511788e 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -38,7 +38,6 @@ CNode* FindNode(const CNetAddr& ip);
 CNode* FindNode(const CService& ip);
 CNode* ConnectNode(CAddress addrConnect, const char *strDest = NULL, int64_t nTimeout=0);
 bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
-void MapPort();
 uint16_t GetListenPort();
 bool BindListenPort(const CService &bindAddr, string& strError=REF(string()));
 void StartNode(void* parg);
index 801610d..3f0d981 100644 (file)
@@ -1177,7 +1177,7 @@ std::string CService::ToString() const
     return ToStringIPPort();
 }
 
-void CService::SetPort(uint16_t portIn)
+void CService::SetupPort(uint16_t portIn)
 {
     port = portIn;
 }
index 80bd90d..14c632e 100644 (file)
 
 extern int nConnectTimeout;
 
-#ifdef WIN32
-// In MSVC, this is defined as a macro, undefine it to prevent a compile and link error
-#undef SetPort
-#endif
-
 enum Network
 {
     NET_UNROUTABLE,
@@ -103,7 +98,7 @@ class CService : public CNetAddr
         explicit CService(const std::string& strIpPort, uint16_t portDefault, bool fAllowLookup = false);
         explicit CService(const std::string& strIpPort, bool fAllowLookup = false);
         void Init();
-        void SetPort(uint16_t portIn);
+        void SetupPort(uint16_t portIn);
         uint16_t GetPort() const;
         bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
         bool SetSockAddr(const struct sockaddr* paddr);
index 6639e27..80fc84f 100644 (file)
@@ -227,7 +227,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
             proxy.first = CService("127.0.0.1", nSocksDefault);
             GetProxy(NET_IPV4, proxy);
 
-            proxy.first.SetPort(value.toInt());
+            proxy.first.SetupPort(value.toInt());
             settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str());
             successful = ApplyProxySettings();
         }
@@ -263,7 +263,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
             proxy.first = CService("127.0.0.1", nSocksDefault);
             GetProxy(NET_TOR, proxy);
 
-            proxy.first.SetPort((uint16_t)value.toUInt());
+            proxy.first.SetupPort((uint16_t)value.toUInt());
             settings.setValue("addrTor", proxy.first.ToStringIPPort().c_str());
             successful = ApplyTorSettings();
         }