MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReadFilterFromDisk

Method ReadFilterFromDisk

src/index/blockfilterindex.cpp:146–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool BlockFilterIndex::ReadFilterFromDisk(const FlatFilePos& pos, BlockFilter& filter) const
147{
148 CAutoFile filein(m_filter_fileseq->Open(pos, true), SER_DISK, CLIENT_VERSION);
149 if (filein.IsNull()) {
150 return false;
151 }
152
153 uint256 block_hash;
154 std::vector<uint8_t> encoded_filter;
155 try {
156 filein >> block_hash >> encoded_filter;
157 filter = BlockFilter(GetFilterType(), block_hash, std::move(encoded_filter));
158 }
159 catch (const std::exception& e) {
160 return error("%s: Failed to deserialize block filter from disk: %s", __func__, e.what());
161 }
162
163 return true;
164}
165
166size_t BlockFilterIndex::WriteFilterToDisk(FlatFilePos& pos, const BlockFilter& filter)
167{

Callers

nothing calls this directly

Calls 4

BlockFilterClass · 0.85
errorFunction · 0.85
OpenMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected