|
|
@ -1430,18 +1430,19 @@ void ThreadOpenConnections2(void* parg) |
|
|
|
//
|
|
|
|
//
|
|
|
|
CAddress addrConnect; |
|
|
|
CAddress addrConnect; |
|
|
|
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.
|
|
|
|
int nOutbound = 0; |
|
|
|
int nOutbound = 0; |
|
|
|
set<vector<unsigned char> > setConnected; |
|
|
|
set<vector<unsigned char> > setConnected; |
|
|
|
{ |
|
|
|
{ |
|
|
|
LOCK(cs_vNodes); |
|
|
|
LOCK(cs_vNodes); |
|
|
|
BOOST_FOREACH(CNode* pnode, vNodes) { |
|
|
|
BOOST_FOREACH(CNode* pnode, vNodes) { |
|
|
|
|
|
|
|
if (!pnode->fInbound) { |
|
|
|
setConnected.insert(pnode->addr.GetGroup()); |
|
|
|
setConnected.insert(pnode->addr.GetGroup()); |
|
|
|
if (!pnode->fInbound) |
|
|
|
|
|
|
|
nOutbound++; |
|
|
|
nOutbound++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int64 nANow = GetAdjustedTime(); |
|
|
|
int64 nANow = GetAdjustedTime(); |
|
|
|
|
|
|
|
|
|
|
|