MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SetSpecial

Method SetSpecial

src/netaddress.cpp:55–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool CNetAddr::SetSpecial(const std::string &strName)
56{
57 if (strName.size()>6 && strName.substr(strName.size() - 6, 6) == ".onion") {
58 std::vector<unsigned char> vchAddr = DecodeBase32(strName.substr(0, strName.size() - 6).c_str());
59 if (vchAddr.size() != 16-sizeof(pchOnionCat))
60 return false;
61 memcpy(ip, pchOnionCat, sizeof(pchOnionCat));
62 for (unsigned int i=0; i<16-sizeof(pchOnionCat); i++)
63 ip[i + sizeof(pchOnionCat)] = vchAddr[i];
64 return true;
65 }
66 return false;
67}
68
69CNetAddr::CNetAddr(const struct in_addr& ipv4Addr)
70{

Callers 1

LookupInternFunction · 0.80

Calls 3

DecodeBase32Function · 0.85
memcpyFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected