diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-11 15:47:52 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-19 16:38:08 +0200 |
commit | fa72f09d6ff8ee204f331a69d3f5e825223c9e11 (patch) | |
tree | d45356514481c7a21d7fe4c87681a85bfdd86347 /src/hash.h | |
parent | fa4a9c0f4334678fb80358ead667807bf2a0a153 (diff) |
Remove CHashWriter type
The type is only ever set, but never read via GetType(), so remove it.
Also, remove SerializeHash to avoid silent merge conflicts and use the
already existing GetHash() boilerplate consistently.
Diffstat (limited to 'src/hash.h')
-rw-r--r-- | src/hash.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/hash.h b/src/hash.h index f2b627ff4f..d355b703ff 100644 --- a/src/hash.h +++ b/src/hash.h @@ -149,13 +149,11 @@ public: class CHashWriter : public HashWriter { private: - const int nType; const int nVersion; public: - CHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {} + CHashWriter(int nVersionIn) : nVersion{nVersionIn} {} - int GetType() const { return nType; } int GetVersion() const { return nVersion; } template<typename T> @@ -223,15 +221,6 @@ public: } }; -/** Compute the 256-bit hash of an object's serialization. */ -template<typename T> -uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) -{ - CHashWriter ss(nType, nVersion); - ss << obj; - return ss.GetHash(); -} - /** Single-SHA256 a 32-byte input (represented as uint256). */ [[nodiscard]] uint256 SHA256Uint256(const uint256& input); |