Skip to content

Commit

Permalink
net: remove unused CNetAddr::GetHash()
Browse files Browse the repository at this point in the history
  • Loading branch information
vasild committed Feb 11, 2022
1 parent d0abce9 commit 36ee76d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
8 changes: 0 additions & 8 deletions src/netaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,14 +833,6 @@ std::vector<unsigned char> CNetAddr::GetAddrBytes() const
return std::vector<unsigned char>(m_addr.begin(), m_addr.end());
}

uint64_t CNetAddr::GetHash() const
{
uint256 hash = Hash(m_addr);
uint64_t nRet;
memcpy(&nRet, &hash, sizeof(nRet));
return nRet;
}

// private extensions to enum Network, only returned by GetExtNetwork,
// and only used in GetReachabilityFrom
static const int NET_UNKNOWN = NET_MAX + 0;
Expand Down
1 change: 0 additions & 1 deletion src/netaddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class CNetAddr
enum Network GetNetwork() const;
std::string ToString() const;
std::string ToStringIP() const;
uint64_t GetHash() const;
bool GetInAddr(struct in_addr* pipv4Addr) const;
Network GetNetClass() const;

Expand Down
1 change: 0 additions & 1 deletion src/test/fuzz/netaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ FUZZ_TARGET(netaddress)
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());

const CNetAddr net_addr = ConsumeNetAddr(fuzzed_data_provider);
(void)net_addr.GetHash();
(void)net_addr.GetNetClass();
if (net_addr.GetNetwork() == Network::NET_IPV4) {
assert(net_addr.IsIPv4());
Expand Down

0 comments on commit 36ee76d

Please sign in to comment.