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

Class DBHeightKey

src/index/coinstatsindex.cpp:60–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60struct 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
83struct DBHashKey {
84 uint256 block_hash;

Callers 3

WriteBlockMethod · 0.70
LookUpOneFunction · 0.70
ReverseBlockMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected