aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/netaddress.h')
-rw-r--r--src/netaddress.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/netaddress.h b/src/netaddress.h
index b06b6c65b6..6d21dcd5cd 100644
--- a/src/netaddress.h
+++ b/src/netaddress.h
@@ -194,7 +194,6 @@ public:
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;
@@ -562,6 +561,14 @@ public:
class CServiceHash
{
public:
+ CServiceHash()
+ : m_salt_k0{GetRand(std::numeric_limits<uint64_t>::max())},
+ m_salt_k1{GetRand(std::numeric_limits<uint64_t>::max())}
+ {
+ }
+
+ CServiceHash(uint64_t salt_k0, uint64_t salt_k1) : m_salt_k0{salt_k0}, m_salt_k1{salt_k1} {}
+
size_t operator()(const CService& a) const noexcept
{
CSipHasher hasher(m_salt_k0, m_salt_k1);
@@ -572,8 +579,8 @@ public:
}
private:
- const uint64_t m_salt_k0 = GetRand(std::numeric_limits<uint64_t>::max());
- const uint64_t m_salt_k1 = GetRand(std::numeric_limits<uint64_t>::max());
+ const uint64_t m_salt_k0;
+ const uint64_t m_salt_k1;
};
#endif // BITCOIN_NETADDRESS_H