Skip to content

Commit a0c254c

Browse files
committed
Drop CHashWriter
1 parent c94f7e5 commit a0c254c

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/hash.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,6 @@ class HashWriter
146146
}
147147
};
148148

149-
class CHashWriter : public HashWriter
150-
{
151-
private:
152-
const int nVersion;
153-
154-
public:
155-
CHashWriter(int nVersionIn) : nVersion{nVersionIn} {}
156-
157-
int GetVersion() const { return nVersion; }
158-
159-
template<typename T>
160-
CHashWriter& operator<<(const T& obj) {
161-
::Serialize(*this, obj);
162-
return (*this);
163-
}
164-
};
165-
166149
/** Reads data from an underlying stream, while hashing the read data. */
167150
template <typename Source>
168151
class HashVerifier : public HashWriter

src/primitives/block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
uint256 CBlockHeader::GetHash() const
1212
{
13-
return (CHashWriter{PROTOCOL_VERSION} << *this).GetHash();
13+
return (HashWriter{} << *this).GetHash();
1414
}
1515

1616
std::string CBlock::ToString() const

src/test/hash_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(siphash)
122122
(uint64_t(x+4)<<32)|(uint64_t(x+5)<<40)|(uint64_t(x+6)<<48)|(uint64_t(x+7)<<56));
123123
}
124124

125-
CHashWriter ss{CLIENT_VERSION};
125+
HashWriter ss{};
126126
CMutableTransaction tx;
127127
// Note these tests were originally written with tx.nVersion=1
128128
// and the test would be affected by default tx version bumps if not fixed.

0 commit comments

Comments
 (0)