aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2023-09-08 05:18:41 +1000
committerAnthony Towns <aj@erisian.com.au>2023-11-14 08:45:32 +1000
commita0c254c13a3ef21e257cca3493446c632b636b15 (patch)
tree2d0f34372e33286ca40c846d8782fdc538e55e00 /src
parentc94f7e5b1cd1ddff2a7d95cfad5a83c9dfa526be (diff)
Drop CHashWriter
Diffstat (limited to 'src')
-rw-r--r--src/hash.h17
-rw-r--r--src/primitives/block.cpp2
-rw-r--r--src/test/hash_tests.cpp2
3 files changed, 2 insertions, 19 deletions
diff --git a/src/hash.h b/src/hash.h
index d355b703ff..132e1a9fb3 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -146,23 +146,6 @@ public:
}
};
-class CHashWriter : public HashWriter
-{
-private:
- const int nVersion;
-
-public:
- CHashWriter(int nVersionIn) : nVersion{nVersionIn} {}
-
- int GetVersion() const { return nVersion; }
-
- template<typename T>
- CHashWriter& operator<<(const T& obj) {
- ::Serialize(*this, obj);
- return (*this);
- }
-};
-
/** Reads data from an underlying stream, while hashing the read data. */
template <typename Source>
class HashVerifier : public HashWriter
diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp
index 3d21708820..27da161e1e 100644
--- a/src/primitives/block.cpp
+++ b/src/primitives/block.cpp
@@ -10,7 +10,7 @@
uint256 CBlockHeader::GetHash() const
{
- return (CHashWriter{PROTOCOL_VERSION} << *this).GetHash();
+ return (HashWriter{} << *this).GetHash();
}
std::string CBlock::ToString() const
diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp
index d2ef6a4cbd..f0d2b9ed72 100644
--- a/src/test/hash_tests.cpp
+++ b/src/test/hash_tests.cpp
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(siphash)
(uint64_t(x+4)<<32)|(uint64_t(x+5)<<40)|(uint64_t(x+6)<<48)|(uint64_t(x+7)<<56));
}
- CHashWriter ss{CLIENT_VERSION};
+ HashWriter ss{};
CMutableTransaction tx;
// Note these tests were originally written with tx.nVersion=1
// and the test would be affected by default tx version bumps if not fixed.