Changeset View
Changeset View
Standalone View
Standalone View
src/addrman.cpp
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Lines | |||||
int CAddrMan::Check_() { | int CAddrMan::Check_() { | ||||
std::set<int> setTried; | std::set<int> setTried; | ||||
std::map<int, int> mapNew; | std::map<int, int> mapNew; | ||||
if (vRandom.size() != nTried + nNew) { | if (vRandom.size() != nTried + nNew) { | ||||
return -7; | return -7; | ||||
} | } | ||||
for (std::map<int, CAddrInfo>::iterator it = mapInfo.begin(); | for (const auto &entry : mapInfo) { | ||||
it != mapInfo.end(); it++) { | int n = entry.first; | ||||
int n = (*it).first; | const CAddrInfo &info = entry.second; | ||||
CAddrInfo &info = (*it).second; | |||||
if (info.fInTried) { | if (info.fInTried) { | ||||
if (!info.nLastSuccess) { | if (!info.nLastSuccess) { | ||||
return -1; | return -1; | ||||
} | } | ||||
if (info.nRefCount) { | if (info.nRefCount) { | ||||
return -2; | return -2; | ||||
} | } | ||||
setTried.insert(n); | setTried.insert(n); | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |