MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / LoadTorIPsFromWeb

Function LoadTorIPsFromWeb

src/ipgroups.cpp:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163static 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
181static void LoadTorIPsFromStaticData() {
182 CIPGroup ipGroup;

Callers 1

PollTorWebsiteFunction · 0.85

Calls 1

LoadIPDataFromWebFunction · 0.85

Tested by

no test coverage detected