aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-07-06 00:41:57 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2012-07-06 00:41:57 +0000
commitf1830a9a225d475fd566622c7f4f847e387e3b12 (patch)
tree04f807e0d9c6f11d3517f6b2dcf2253cb557744e /src/net.cpp
parentcf6ab20d8b53503a4727bd86d1747efbe013a417 (diff)
parent580f7cd73189c6840b354c9ed6a0227161150fcc (diff)
downloadbitcoin-f1830a9a225d475fd566622c7f4f847e387e3b12.tar.xz
Merge branch '0.4.x' into 0.5.x
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 0c98b8ee3e..e0041ed24b 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1542,12 +1542,14 @@ void ThreadOpenConnections2(void* parg)
CAddress addrConnect;
int64 nBest = std::numeric_limits<int64>::min();
- // Only connect to one address per a.b.?.? range.
+ // Only connect out to one peer per network group (/16 for IPv4).
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.
set<unsigned int> setConnected;
CRITICAL_BLOCK(cs_vNodes)
BOOST_FOREACH(CNode* pnode, vNodes)
- setConnected.insert(pnode->addr.ip & 0x0000ffff);
+ if (!pnode->fInbound) {
+ setConnected.insert(pnode->addr.ip & 0x0000ffff);
+ }
int64 nANow = GetAdjustedTime();