diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/hasher.cpp | 5 | ||||
-rw-r--r-- | src/util/hasher.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/util/hasher.cpp b/src/util/hasher.cpp index a3a3f7a429..81e9b990e1 100644 --- a/src/util/hasher.cpp +++ b/src/util/hasher.cpp @@ -9,7 +9,10 @@ SaltedTxidHasher::SaltedTxidHasher() : k0(GetRand<uint64_t>()), k1(GetRand<uint64_t>()) {} -SaltedOutpointHasher::SaltedOutpointHasher() : k0(GetRand<uint64_t>()), k1(GetRand<uint64_t>()) {} +SaltedOutpointHasher::SaltedOutpointHasher(bool deterministic) : + k0(deterministic ? 0x8e819f2607a18de6 : GetRand<uint64_t>()), + k1(deterministic ? 0xf4020d2e3983b0eb : GetRand<uint64_t>()) +{} SaltedSipHasher::SaltedSipHasher() : m_k0(GetRand<uint64_t>()), m_k1(GetRand<uint64_t>()) {} diff --git a/src/util/hasher.h b/src/util/hasher.h index 82d278b086..506ae9415d 100644 --- a/src/util/hasher.h +++ b/src/util/hasher.h @@ -36,7 +36,7 @@ private: const uint64_t k0, k1; public: - SaltedOutpointHasher(); + SaltedOutpointHasher(bool deterministic = false); /** * Having the hash noexcept allows libstdc++'s unordered_map to recalculate |