Skip to content

Commit fa626af

Browse files
author
MarcoFalke
committed
Remove unused legacy CHashVerifier
1 parent fafa3fc commit fa626af

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

src/hash.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -199,39 +199,6 @@ class HashVerifier : public HashWriter
199199
}
200200
};
201201

202-
template<typename Source>
203-
class CHashVerifier : public CHashWriter
204-
{
205-
private:
206-
Source* source;
207-
208-
public:
209-
explicit CHashVerifier(Source* source_) : CHashWriter(source_->GetType(), source_->GetVersion()), source(source_) {}
210-
211-
void read(Span<std::byte> dst)
212-
{
213-
source->read(dst);
214-
this->write(dst);
215-
}
216-
217-
void ignore(size_t nSize)
218-
{
219-
std::byte data[1024];
220-
while (nSize > 0) {
221-
size_t now = std::min<size_t>(nSize, 1024);
222-
read({data, now});
223-
nSize -= now;
224-
}
225-
}
226-
227-
template<typename T>
228-
CHashVerifier<Source>& operator>>(T&& obj)
229-
{
230-
::Unserialize(*this, obj);
231-
return (*this);
232-
}
233-
};
234-
235202
/** Writes data to an underlying source stream, while hashing the written data. */
236203
template <typename Source>
237204
class HashedSourceWriter : public HashWriter

src/test/streams_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,12 @@ BOOST_AUTO_TEST_CASE(streams_buffered_file_rand)
553553

554554
BOOST_AUTO_TEST_CASE(streams_hashed)
555555
{
556-
CDataStream stream(SER_NETWORK, INIT_PROTO_VERSION);
556+
DataStream stream{};
557557
HashedSourceWriter hash_writer{stream};
558558
const std::string data{"bitcoin"};
559559
hash_writer << data;
560560

561-
CHashVerifier hash_verifier{&stream};
561+
HashVerifier hash_verifier{stream};
562562
std::string result;
563563
hash_verifier >> result;
564564
BOOST_CHECK_EQUAL(data, result);

0 commit comments

Comments
 (0)