aboutsummaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-11 15:47:52 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-19 16:38:08 +0200
commitfa72f09d6ff8ee204f331a69d3f5e825223c9e11 (patch)
treed45356514481c7a21d7fe4c87681a85bfdd86347 /src/hash.h
parentfa4a9c0f4334678fb80358ead667807bf2a0a153 (diff)
downloadbitcoin-fa72f09d6ff8ee204f331a69d3f5e825223c9e11.tar.xz
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.h13
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);