| 58 | }; |
| 59 | |
| 60 | struct DBHeightKey { |
| 61 | int height; |
| 62 | |
| 63 | explicit DBHeightKey(int height_in) : height(height_in) {} |
| 64 | |
| 65 | template <typename Stream> |
| 66 | void Serialize(Stream& s) const |
| 67 | { |
| 68 | ser_writedata8(s, DB_BLOCK_HEIGHT); |
| 69 | ser_writedata32be(s, height); |
| 70 | } |
| 71 | |
| 72 | template <typename Stream> |
| 73 | void Unserialize(Stream& s) |
| 74 | { |
| 75 | const uint8_t prefix{ser_readdata8(s)}; |
| 76 | if (prefix != DB_BLOCK_HEIGHT) { |
| 77 | throw std::ios_base::failure("Invalid format for coinstatsindex DB height key"); |
| 78 | } |
| 79 | height = ser_readdata32be(s); |
| 80 | } |
| 81 | }; |
| 82 | |
| 83 | struct DBHashKey { |
| 84 | uint256 block_hash; |
no outgoing calls
no test coverage detected