MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ToStringAddr

Method ToStringAddr

src/netaddress.cpp:580–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580std::string CNetAddr::ToStringAddr() const
581{
582 switch (m_net) {
583 case NET_IPV4:
584 return IPv4ToString(m_addr);
585 case NET_IPV6:
586 return IPv6ToString(m_addr, m_scope_id);
587 case NET_ONION:
588 return OnionToString(m_addr);
589 case NET_I2P:
590 return EncodeBase32(m_addr, false /* don't pad with = */) + ".b32.i2p";
591 case NET_CJDNS:
592 return IPv6ToString(m_addr, 0);
593 case NET_INTERNAL:
594 return EncodeBase32(m_addr) + ".internal";
595 case NET_UNROUTABLE: // m_net is never and should not be set to NET_UNROUTABLE
596 case NET_MAX: // m_net is never and should not be set to NET_MAX
597 assert(false);
598 } // no default case, so the compiler can warn about missing cases
599
600 assert(false);
601}
602
603bool operator==(const CNetAddr& a, const CNetAddr& b)
604{

Callers 15

ConnectMethod · 0.80
Add_Method · 0.80
ToStringMethod · 0.80
ProcessPCPFunction · 0.80
ConnectNodeMethod · 0.80
DiscoverFunction · 0.80
AddedNodesContainMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
banman.cppFile · 0.80
FUZZ_TARGETFunction · 0.80
updateNetworkStateMethod · 0.80

Calls 4

IPv4ToStringFunction · 0.85
IPv6ToStringFunction · 0.85
OnionToStringFunction · 0.85
EncodeBase32Function · 0.85

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64