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

Class DBHeightKey

src/index/blockfilterindex.cpp:53–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51};
52
53struct 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
76struct DBHashKey {
77 uint256 hash;

Callers 3

WriteBlockMethod · 0.70
LookupOneFunction · 0.70
LookupRangeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected