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

Function GetBindAddress

src/netbase.cpp:970–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

968}
969
970CService GetBindAddress(const Sock& sock)
971{
972 CService addr_bind;
973 sockaddr_storage storage;
974 socklen_t len = sizeof(storage);
975
976 auto sa = reinterpret_cast<sockaddr*>(&storage);
977
978 if (sock.GetSockName(sa, &len) == 0) {
979 addr_bind.SetSockAddr(sa, len);
980 } else {
981 LogWarning("getsockname failed\n");
982 }
983 return addr_bind;
984}

Callers 2

ConnectNodeMethod · 0.85
AcceptConnectionMethod · 0.85

Calls 2

SetSockAddrMethod · 0.80
GetSockNameMethod · 0.45

Tested by

no test coverage detected