| 161 | } |
| 162 | |
| 163 | static CIPGroup *LoadTorIPsFromWeb() { |
| 164 | string ourip = "255.255.255.255"; |
| 165 | { |
| 166 | LOCK(cs_mapLocalHost); |
| 167 | // Just use the first IPv4 address for now. We could try all of them later on. |
| 168 | BOOST_FOREACH(const PAIRTYPE(CNetAddr, LocalServiceInfo) &item, mapLocalHost) |
| 169 | { |
| 170 | LogPrintf("Local IP: %s\n", item.first.ToString()); |
| 171 | if (item.first.IsIPv4()) { |
| 172 | ourip = item.first.ToStringIP(); |
| 173 | break; |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | string url = strprintf("https://check.torproject.org/torbulkexitlist?ip=%s&port=8333", ourip); |
| 178 | return LoadIPDataFromWeb(url, "tor", OPEN_PROXY_PRIORITY); |
| 179 | } |
| 180 | |
| 181 | static void LoadTorIPsFromStaticData() { |
| 182 | CIPGroup ipGroup; |
no test coverage detected