Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 1,697 Lines • ▼ Show 20 Lines | while (!interruptNet) { | ||||
} | } | ||||
} | } | ||||
// | // | ||||
// Choose an address to connect to based on most recently seen | // Choose an address to connect to based on most recently seen | ||||
// | // | ||||
CAddress addrConnect; | CAddress addrConnect; | ||||
// Only connect out to one peer per network group (/16 for IPv4). Do | // Only connect out to one peer per network group (/16 for IPv4). | ||||
// this here so we don't have to critsect vNodes inside mapAddresses | |||||
// critsect. | |||||
int nOutbound = 0; | int nOutbound = 0; | ||||
std::set<std::vector<uint8_t>> setConnected; | std::set<std::vector<uint8_t>> setConnected; | ||||
{ | { | ||||
LOCK(cs_vNodes); | LOCK(cs_vNodes); | ||||
for (const CNode *pnode : vNodes) { | for (const CNode *pnode : vNodes) { | ||||
if (!pnode->fInbound && !pnode->m_manual_connection) { | if (!pnode->fInbound && !pnode->m_manual_connection) { | ||||
// Netgroups for inbound and addnode peers are not excluded | // Netgroups for inbound and addnode peers are not excluded | ||||
// because our goal here is to not use multiple of our | // because our goal here is to not use multiple of our | ||||
▲ Show 20 Lines • Show All 1,127 Lines • Show Last 20 Lines |