Fix addnode "onetry": Connect with OpenNetworkConnection
authorfsb4000 <fsb4000@yandex.ru>
Tue, 30 Dec 2014 22:12:48 +0000 (04:12 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Tue, 30 Dec 2014 22:12:48 +0000 (04:12 +0600)
src/net.cpp
src/net.h
src/rpcnet.cpp

index 821cff8..4f8b565 100644 (file)
@@ -35,8 +35,6 @@ void ThreadOpenAddedConnections2(void* parg);
 void ThreadMapPort2(void* parg);
 #endif
 void ThreadDNSAddressSeed2(void* parg);
-bool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);
-
 
 struct LocalServiceInfo {
     int nScore;
index 56a3391..a946210 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -39,6 +39,7 @@ void AddressCurrentlyConnected(const CService& addr);
 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();
 unsigned short GetListenPort();
 bool BindListenPort(const CService &bindAddr, std::string& strError=REF(std::string()));
index c2c22e2..604db0f 100644 (file)
@@ -88,7 +88,7 @@ Value addnode(const Array& params, bool fHelp)
     if (strCommand == "onetry")
     {
         CAddress addr;
-        ConnectNode(addr, strNode.c_str());
+        OpenNetworkConnection(addr, NULL, strNode.c_str());
         return Value::null;
     }