diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-12-05 11:32:24 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-12-05 11:39:18 +0100 |
commit | 800458eddd4aa6ea12aca6aec4b2567283260a34 (patch) | |
tree | 8ab08b8e47d731019f0fdd020bcb04473f44ab7c /src/net.cpp | |
parent | 7a88e3b0fcebf3c39a88158236c1382538478008 (diff) | |
parent | 35e408f8a48a5406cec214c1d660e6f6a2d026f3 (diff) |
Merge pull request #5408
35e408f Regard connection failures as attempt for addrman (Wladimir J. van der Laan)
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 8668d5017d..42b3c30fb7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -399,7 +399,9 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) // Connect SOCKET hSocket; - if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, Params().GetDefaultPort()) : ConnectSocket(addrConnect, hSocket)) + bool proxyConnectionFailed = false; + if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, Params().GetDefaultPort(), nConnectTimeout, &proxyConnectionFailed) : + ConnectSocket(addrConnect, hSocket, nConnectTimeout, &proxyConnectionFailed)) { addrman.Attempt(addrConnect); @@ -415,6 +417,10 @@ CNode* ConnectNode(CAddress addrConnect, const char *pszDest) pnode->nTimeConnected = GetTime(); return pnode; + } else if (!proxyConnectionFailed) { + // If connecting to the node failed, and failure is not caused by a problem connecting to + // the proxy, mark this as an attempt. + addrman.Attempt(addrConnect); } return NULL; |