| 51 | }; |
| 52 | |
| 53 | struct DBHeightKey { |
| 54 | int height; |
| 55 | |
| 56 | explicit DBHeightKey(int height_in) : height(height_in) {} |
| 57 | |
| 58 | template<typename Stream> |
| 59 | void Serialize(Stream& s) const |
| 60 | { |
| 61 | ser_writedata8(s, DB_BLOCK_HEIGHT); |
| 62 | ser_writedata32be(s, height); |
| 63 | } |
| 64 | |
| 65 | template<typename Stream> |
| 66 | void Unserialize(Stream& s) |
| 67 | { |
| 68 | const uint8_t prefix{ser_readdata8(s)}; |
| 69 | if (prefix != DB_BLOCK_HEIGHT) { |
| 70 | throw std::ios_base::failure("Invalid format for block filter index DB height key"); |
| 71 | } |
| 72 | height = ser_readdata32be(s); |
| 73 | } |
| 74 | }; |
| 75 | |
| 76 | struct DBHashKey { |
| 77 | uint256 hash; |
no outgoing calls
no test coverage detected