Changeset View
Changeset View
Standalone View
Standalone View
src/index/blockfilterindex.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
namespace { | namespace { | ||||
struct DBVal { | struct DBVal { | ||||
uint256 hash; | uint256 hash; | ||||
uint256 header; | uint256 header; | ||||
FlatFilePos pos; | FlatFilePos pos; | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(DBVal, obj) { READWRITE(obj.hash, obj.header, obj.pos); } | ||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(hash); | |||||
READWRITE(header); | |||||
READWRITE(pos); | |||||
} | |||||
}; | }; | ||||
struct DBHeightKey { | struct DBHeightKey { | ||||
int height; | int height; | ||||
DBHeightKey() : height(0) {} | DBHeightKey() : height(0) {} | ||||
explicit DBHeightKey(int height_in) : height(height_in) {} | explicit DBHeightKey(int height_in) : height(height_in) {} | ||||
Show All 12 Lines | struct DBHeightKey { | ||||
} | } | ||||
}; | }; | ||||
struct DBHashKey { | struct DBHashKey { | ||||
BlockHash hash; | BlockHash hash; | ||||
explicit DBHashKey(const BlockHash &hash_in) : hash(hash_in) {} | explicit DBHashKey(const BlockHash &hash_in) : hash(hash_in) {} | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
majcosta: missed this one | |||||
char prefix = DB_BLOCK_HASH; | char prefix = DB_BLOCK_HASH; | ||||
READWRITE(prefix); | READWRITE(prefix); | ||||
if (prefix != DB_BLOCK_HASH) { | if (prefix != DB_BLOCK_HASH) { | ||||
throw std::ios_base::failure( | throw std::ios_base::failure( | ||||
"Invalid format for block filter index DB hash key"); | "Invalid format for block filter index DB hash key"); | ||||
} | } | ||||
READWRITE(hash); | READWRITE(hash); | ||||
▲ Show 20 Lines • Show All 416 Lines • Show Last 20 Lines |
missed this one