From f9c88079df8b78b8fab75e0903ca395654f2d360 Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Thu, 5 Jan 2017 12:03:01 -0500 Subject: Deduplicate SignatureCacheHasher This moves the SignatureCacheHasher to the sigcache header, out of the anonymous namespace, so that the tests can import it. --- src/script/sigcache.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/script/sigcache.cpp') diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index 6f47b725fb..7bb8d9941b 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -15,28 +15,6 @@ #include namespace { - -/** - * We're hashing a nonce into the entries themselves, so we don't need extra - * blinding in the set hash computation. - * - * This may exhibit platform endian dependent behavior but because these are - * nonced hashes (random) and this state is only ever used locally it is safe. - * All that matters is local consistency. - */ -class SignatureCacheHasher -{ -public: - template - uint32_t operator()(const uint256& key) const - { - static_assert(hash_select <8, "SignatureCacheHasher only has 8 hashes available."); - uint32_t u; - std::memcpy(&u, key.begin()+4*hash_select, 4); - return u; - } -}; - /** * Valid signature cache, to avoid doing expensive ECDSA signature checking * twice for every transaction (once when accepted into memory pool, and -- cgit v1.2.3