veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::BlockIndex< Block > Struct Template Reference

A node in a block tree. More...

Detailed Description

template<typename Block>
struct altintegration::BlockIndex< Block >
Template Parameters
Block

Definition at line 31 of file block_index.hpp.

#include <block_index.hpp>

+ Inheritance diagram for altintegration::BlockIndex< Block >:
+ Collaboration diagram for altintegration::BlockIndex< Block >:

Public Types

using block_t = Block
 
using addon_t = typename Block::addon_t
 
using hash_t = typename block_t::hash_t
 
using prev_hash_t = typename block_t::prev_hash_t
 
using height_t = typename block_t::height_t
 

Public Member Functions

 BlockIndex (BlockIndex *prev)
 create a regular block in a deleted state More...
 
 BlockIndex (height_t _height)
 create a root block in a deleted state More...
 
void disconnectFromPrev ()
 
bool isTip () const
 
 BlockIndex (BlockIndex &&other)=default
 
BlockIndexoperator= (BlockIndex &&other)=default
 
bool isDeleted () const
 
bool isRoot () const
 
void restore ()
 
void deleteTemporarily ()
 
void mergeFrom (const StoredBlockIndex< Block > &other)
 
StoredBlockIndex< Block > toStoredBlockIndex () const
 
bool isConnected () const noexcept
 Block is connected if it contains block body (PopData), and all its ancestors are connected. More...
 
uint32_t getStatus () const
 
void setStatus (uint32_t _status)
 
uint32_t getValidityLevel () const
 
bool isFailed () const
 
bool isValid (enum BlockStateStatus upTo=BLOCK_VALID_TREE) const
 
bool isValidUpTo (enum BlockStateStatus upTo) const
 
void setNull ()
 
void setNullInmemFields ()
 
bool raiseValidity (enum BlockStateStatus upTo)
 
bool lowerValidity (enum BlockStateStatus upTo)
 
void setDirty ()
 
void unsetDirty ()
 
bool isDirty () const
 
void setFlag (enum BlockValidityStatus s)
 
void unsetFlag (enum BlockValidityStatus s)
 
bool hasFlags (enum BlockValidityStatus s) const
 
const hash_t & getHash () const
 
uint32_t getTimestamp () const
 
uint32_t getDifficulty () const
 
height_t getHeight () const
 
void setHeight (const height_t newHeight)
 
const block_t & getHeader () const
 
void setHeader (const block_t &newHeader)
 
void setHeader (std::shared_ptr< block_t > newHeader)
 
bool canBeATip () const
 
bool isValidTip () const
 The block is a valid tip if it can be a tip and either there are no descendant blocks or none of the descendants can be a tip. More...
 
bool allDescendantsUnapplied () const
 Check if all immediate descendants of the block are unapplied. More...
 
size_t nondeletedDescendantCount () const
 Count the descendants that are not deleted. More...
 
bool allDescendantsUnconnected () const
 Check if all immediate descendants of the block are not connected. More...
 
const BlockIndexgetAncestorBlocksBehind (height_t steps) const
 
const BlockIndexgetPrev () const
 
BlockIndexgetPrev ()
 
bool isDescendantOf (const BlockIndex &ancestor) const
 
bool isAncestorOf (const BlockIndex &descendant) const
 
const BlockIndexgetAncestor (height_t _height) const
 
BlockIndexgetAncestor (height_t _height)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
std::string toPrettyString (size_t level=0) const
 
std::string toShortPrettyString () const
 

Public Attributes

BlockIndexpprev = nullptr
 (memory only) pointer to the previous block More...
 
std::set< BlockIndex * > pnext {}
 (memory only) a set of pointers for forward iteration More...
 
bool finalized = false
 (memory only) if true, this block can not be reorganized More...
 

Protected Attributes

height_t height = 0
 height of the entry in the chain More...
 
std::shared_ptr< block_t > header = std::make_shared<block_t>()
 block header More...
 
uint32_t status = BLOCK_VALID_UNKNOWN | BLOCK_DELETED
 contains status flags More...
 
bool dirty = false
 (memory only) if true, this block should be written on disk More...
 

Friends

bool operator== (const BlockIndex &a, const BlockIndex &b)
 
bool operator!= (const BlockIndex &a, const BlockIndex &b)
 

Member Typedef Documentation

◆ addon_t

template<typename Block >
using altintegration::BlockIndex< Block >::addon_t = typename Block::addon_t

Definition at line 33 of file block_index.hpp.

◆ block_t

template<typename Block >
using altintegration::BlockIndex< Block >::block_t = Block

Definition at line 32 of file block_index.hpp.

◆ hash_t

template<typename Block >
using altintegration::BlockIndex< Block >::hash_t = typename block_t::hash_t

Definition at line 34 of file block_index.hpp.

◆ height_t

template<typename Block >
using altintegration::BlockIndex< Block >::height_t = typename block_t::height_t

Definition at line 36 of file block_index.hpp.

◆ prev_hash_t

template<typename Block >
using altintegration::BlockIndex< Block >::prev_hash_t = typename block_t::prev_hash_t

Definition at line 35 of file block_index.hpp.

Constructor & Destructor Documentation

◆ BlockIndex() [1/2]

template<typename Block >
altintegration::BlockIndex< Block >::BlockIndex ( BlockIndex< Block > *  prev)
inline

Definition at line 48 of file block_index.hpp.

48 : pprev(prev) {
49 // FIXME: prev should be a reference
50 VBK_ASSERT(prev != nullptr);
51
52 pprev->pnext.insert(this);
53
54 if (pprev->isFailed()) {
55 setFlag(BLOCK_FAILED_CHILD);
56 }
57
58 height = prev->getHeight() + 1;
59
60 // TODO: what dirtiness should it have here?
61 }
@ BLOCK_FAILED_CHILD
block is state{lessly,fully} valid and the altchain did not report it as invalid, but some of the anc...
BlockIndex * pprev
(memory only) pointer to the previous block
Definition: block_index.hpp:39
std::set< BlockIndex * > pnext
(memory only) a set of pointers for forward iteration
Definition: block_index.hpp:42
height_t height
height of the entry in the chain

◆ BlockIndex() [2/2]

template<typename Block >
altintegration::BlockIndex< Block >::BlockIndex ( height_t  _height)
inlineexplicit

Definition at line 64 of file block_index.hpp.

64: pprev(nullptr), height(_height) {}

◆ ~BlockIndex()

template<typename Block >
altintegration::BlockIndex< Block >::~BlockIndex ( )
inline

Definition at line 66 of file block_index.hpp.

66 {
67 // before block is deallocated it must be disconnected and deleted.
68 VBK_ASSERT(isTip());
69 VBK_ASSERT(isDeleted());
70 VBK_ASSERT_MSG(pprev == nullptr, pprev->toPrettyString());
71 }

Member Function Documentation

◆ allDescendantsUnapplied()

template<typename Block >
bool altintegration::BlockIndex< Block >::allDescendantsUnapplied ( ) const
inline

Definition at line 286 of file block_index.hpp.

286 {
287 return isTip() ||
288 std::none_of(pnext.begin(), pnext.end(), [](BlockIndex* index) {
289 return index->hasFlags(BLOCK_ACTIVE);
290 });
291 }
BlockIndex(BlockIndex *prev)
create a regular block in a deleted state
Definition: block_index.hpp:48

◆ allDescendantsUnconnected()

template<typename Block >
bool altintegration::BlockIndex< Block >::allDescendantsUnconnected ( ) const
inline

Definition at line 306 of file block_index.hpp.

306 {
307 return isTip() ||
308 std::none_of(pnext.begin(), pnext.end(), [](BlockIndex* index) {
309 return index->isConnected();
310 });
311 }

◆ canBeATip()

template<typename Block >
bool altintegration::BlockIndex< Block >::canBeATip ( ) const
inline

Definition at line 268 of file block_index.hpp.

268 {
269 return !isDeleted() && isValid(addon_t::validTipLevel);
270 }

◆ deleteTemporarily()

template<typename Block >
void altintegration::BlockIndex< Block >::deleteTemporarily ( )
inline

Definition at line 105 of file block_index.hpp.

105 {
106 VBK_ASSERT_MSG(!isDeleted(),
107 "tried to delete block %s that is already deleted",
108 toPrettyString());
109
110 // FIXME: this is a hack that might eventually bite us
111 addon_t::setNull();
112
113 // preserve FAILED_* flags
116
117 // make it dirty by default
118 setDirty();
119 }
@ BLOCK_VALID_UNKNOWN
default state for validity - validity state is unknown
@ BLOCK_DELETED
the block is temporarily deleted
@ BLOCK_FAILED_MASK
all invalidity flags
uint32_t status
contains status flags

◆ disconnectFromPrev()

template<typename Block >
void altintegration::BlockIndex< Block >::disconnectFromPrev ( )
inline

Definition at line 73 of file block_index.hpp.

73 {
74 if (pprev == nullptr) {
75 // this block is already root
76 return;
77 }
78
79 VBK_ASSERT_MSG(pprev->pnext.count(this) > 0, this->toPrettyString());
80 this->pprev->pnext.erase(this);
81 this->pprev = nullptr;
82 }

◆ getAncestor() [1/2]

template<typename Block >
BlockIndex * altintegration::BlockIndex< Block >::getAncestor ( height_t  _height)
inline

Definition at line 366 of file block_index.hpp.

366 {
367 const auto& t = as_const(*this);
368 return const_cast<BlockIndex*>(t.getAncestor(_height));
369 }

◆ getAncestor() [2/2]

template<typename Block >
const BlockIndex * altintegration::BlockIndex< Block >::getAncestor ( height_t  _height) const
inline
Returns
a pointer to ancestor on height _height, if any. If no ancestor on this height, or height is greater than this block height, returns nullptr.

Definition at line 347 of file block_index.hpp.

347 {
348 VBK_ASSERT(_height >= 0);
349 if (_height > this->height) {
350 return nullptr;
351 }
352
353 // TODO: this algorithm is not optimal. for O(n) seek backwards until we hit
354 // valid height. also it assumes whole blockchain is in memory (pprev is
355 // valid until given height)
356 const BlockIndex* index = this;
357 while (index != nullptr && index->height > _height) {
358 index = index->getPrev();
359 }
360
361 VBK_ASSERT(index == nullptr || index->height == _height);
362 return index;
363 }

◆ getAncestorBlocksBehind()

template<typename Block >
const BlockIndex * altintegration::BlockIndex< Block >::getAncestorBlocksBehind ( height_t  steps) const
inline

Definition at line 313 of file block_index.hpp.

313 {
314 if (steps < 0 || steps > this->height) {
315 return nullptr;
316 }
317
318 return this->getAncestor(this->height - steps);
319 }
const BlockIndex * getAncestor(height_t _height) const

◆ getDifficulty()

template<typename Block >
uint32_t altintegration::BlockIndex< Block >::getDifficulty ( ) const
inline

Definition at line 250 of file block_index.hpp.

250{ return header->getDifficulty(); }
std::shared_ptr< block_t > header
block header

◆ getHash()

template<typename Block >
const hash_t & altintegration::BlockIndex< Block >::getHash ( ) const
inline

Definition at line 248 of file block_index.hpp.

248{ return header->getHash(); }

◆ getHeader()

template<typename Block >
const block_t & altintegration::BlockIndex< Block >::getHeader ( ) const
inline

Definition at line 258 of file block_index.hpp.

258{ return *header; }

◆ getHeight()

template<typename Block >
height_t altintegration::BlockIndex< Block >::getHeight ( ) const
inline

Definition at line 252 of file block_index.hpp.

252{ return height; }

◆ getPrev() [1/2]

template<typename Block >
BlockIndex * altintegration::BlockIndex< Block >::getPrev ( )
inline

Definition at line 331 of file block_index.hpp.

331 {
332 const auto& t = as_const(*this);
333 return const_cast<BlockIndex*>(t.getPrev());
334 }

◆ getPrev() [2/2]

template<typename Block >
const BlockIndex * altintegration::BlockIndex< Block >::getPrev ( ) const
inline

Definition at line 321 of file block_index.hpp.

321 {
322 VBK_ASSERT_MSG(isRoot() || getHeight() == pprev->getHeight() + 1,
323 "state corruption: unexpected height of the previous block "
324 "%s of block %s",
325 pprev->toPrettyString(),
326 toPrettyString());
327
328 return pprev;
329 }

◆ getStatus()

template<typename Block >
uint32_t altintegration::BlockIndex< Block >::getStatus ( ) const
inline

Definition at line 149 of file block_index.hpp.

149{ return status; }

◆ getTimestamp()

template<typename Block >
uint32_t altintegration::BlockIndex< Block >::getTimestamp ( ) const
inline

Definition at line 249 of file block_index.hpp.

249{ return header->getTimestamp(); }

◆ getValidityLevel()

template<typename Block >
uint32_t altintegration::BlockIndex< Block >::getValidityLevel ( ) const
inline

Definition at line 156 of file block_index.hpp.

156 {
157 auto level = status & BLOCK_VALID_MASK;
158 VBK_ASSERT_MSG(level <= BLOCK_CAN_BE_APPLIED, "unknown validity level");
159 return level;
160 }
@ BLOCK_VALID_MASK
all stateful validity levels
@ BLOCK_CAN_BE_APPLIED
the chain with the block at its tip is fully valid, so if we do SetState on this block,...

◆ hasFlags()

template<typename Block >
bool altintegration::BlockIndex< Block >::hasFlags ( enum BlockValidityStatus  s) const
inline

Definition at line 246 of file block_index.hpp.

246{ return this->status & s; }

◆ isAncestorOf()

template<typename Block >
bool altintegration::BlockIndex< Block >::isAncestorOf ( const BlockIndex< Block > &  descendant) const
inline

Definition at line 340 of file block_index.hpp.

340 {
341 return descendant.getAncestor(getHeight()) == this;
342 }

◆ isConnected()

template<typename Block >
bool altintegration::BlockIndex< Block >::isConnected ( ) const
inlinenoexcept
Returns
true if block is connected, false otherwise.

Definition at line 145 of file block_index.hpp.

145 {
146 return this->isValidUpTo(BLOCK_CONNECTED);
147 }
@ BLOCK_CONNECTED
the block is connected via connectBlock, which means that this block and all its ancestors are at lea...

◆ isDeleted()

template<typename Block >
bool altintegration::BlockIndex< Block >::isDeleted ( ) const
inline

Definition at line 93 of file block_index.hpp.

93{ return hasFlags(BLOCK_DELETED); };

◆ isDescendantOf()

template<typename Block >
bool altintegration::BlockIndex< Block >::isDescendantOf ( const BlockIndex< Block > &  ancestor) const
inline

Definition at line 336 of file block_index.hpp.

336 {
337 return getAncestor(ancestor.getHeight()) == &ancestor;
338 }

◆ isDirty()

template<typename Block >
bool altintegration::BlockIndex< Block >::isDirty ( ) const
inline

Definition at line 231 of file block_index.hpp.

231{ return this->dirty; }
bool dirty
(memory only) if true, this block should be written on disk

◆ isFailed()

template<typename Block >
bool altintegration::BlockIndex< Block >::isFailed ( ) const
inline

Definition at line 162 of file block_index.hpp.

162{ return (status & BLOCK_FAILED_MASK) != 0u; }

◆ isRoot()

template<typename Block >
bool altintegration::BlockIndex< Block >::isRoot ( ) const
inline

Definition at line 94 of file block_index.hpp.

94{ return pprev == nullptr; };

◆ isTip()

template<typename Block >
bool altintegration::BlockIndex< Block >::isTip ( ) const
inline

Definition at line 84 of file block_index.hpp.

84{ return pnext.empty(); }

◆ isValid()

template<typename Block >
bool altintegration::BlockIndex< Block >::isValid ( enum BlockStateStatus  upTo = BLOCK_VALID_TREE) const
inline

Definition at line 164 of file block_index.hpp.

164 {
165 return !isFailed() && isValidUpTo(upTo);
166 }

◆ isValidTip()

template<typename Block >
bool altintegration::BlockIndex< Block >::isValidTip ( ) const
inline

Definition at line 275 of file block_index.hpp.

275 {
276 return canBeATip() &&
277 (isTip() ||
278 std::none_of(pnext.begin(), pnext.end(), [](BlockIndex* index) {
279 return index->canBeATip();
280 }));
281 }

◆ isValidUpTo()

template<typename Block >
bool altintegration::BlockIndex< Block >::isValidUpTo ( enum BlockStateStatus  upTo) const
inline

Definition at line 168 of file block_index.hpp.

168 {
169 auto validityLevel = getValidityLevel();
170 VBK_ASSERT_MSG(
171 validityLevel != BLOCK_CAN_BE_APPLIED || !hasFlags(BLOCK_FAILED_POP),
172 "block %s is both BLOCK_CAN_BE_APPLIED and BLOCK_FAILED_POP which are "
173 "mutually exclusive",
174 toPrettyString());
175
176 return getValidityLevel() >= upTo;
177 }
@ BLOCK_FAILED_POP
block failed state{less,ful} validation due to its payloads

◆ lowerValidity()

template<typename Block >
bool altintegration::BlockIndex< Block >::lowerValidity ( enum BlockStateStatus  upTo)
inline

Definition at line 214 of file block_index.hpp.

214 {
215 // we can't lower the validity of a block that's known to be invalid due to
216 // PoP, as that would incorrectly label another validity level as failed.
217 // BLOCK_FAILED_POP has to be cleared first via revalidateSubtree it's ok to
218 // lower the validity of a block invalidated by altchain
219 if ((status & BLOCK_FAILED_POP) != 0u) {
220 return false;
221 }
222 if ((status & BLOCK_VALID_MASK) > upTo) {
223 status = (status & ~BLOCK_VALID_MASK) | upTo;
224 return true;
225 }
226 return false;
227 }

◆ mergeFrom()

template<typename Block >
void altintegration::BlockIndex< Block >::mergeFrom ( const StoredBlockIndex< Block > &  other)
inline

Definition at line 123 of file block_index.hpp.

123 {
124 setHeight(other.height);
125 setHeader(other.header);
126 setStatus(other.status);
127
128 other.addon.toInmem(*this);
129 }

◆ nondeletedDescendantCount()

template<typename Block >
size_t altintegration::BlockIndex< Block >::nondeletedDescendantCount ( ) const
inline

Definition at line 296 of file block_index.hpp.

296 {
297 return std::count_if(
298 pnext.begin(), pnext.end(), [](const BlockIndex* index) {
299 return !index->isDeleted();
300 });
301 }

◆ raiseValidity()

template<typename Block >
bool altintegration::BlockIndex< Block >::raiseValidity ( enum BlockStateStatus  upTo)
inline

Definition at line 195 of file block_index.hpp.

195 {
196 // we can't raise the validity of a block that's known to be invalid due to
197 // PoP it's ok to raise the validity of a block invalidated by altchain
198 if ((status & BLOCK_FAILED_POP) != 0u) {
199 return false;
200 }
201 if ((status & BLOCK_VALID_MASK) < upTo) {
202 VBK_ASSERT_MSG(isRoot() || pprev->getValidityLevel() >= upTo,
203 "attempted to raise the validity level of block %s beyond "
204 "the validity level of its ancestor %s",
205 toPrettyString(),
206 pprev->toPrettyString());
207
208 status = (status & ~BLOCK_VALID_MASK) | upTo;
209 return true;
210 }
211 return false;
212 }

◆ restore()

template<typename Block >
void altintegration::BlockIndex< Block >::restore ( )
inline

Definition at line 96 of file block_index.hpp.

96 {
97 VBK_ASSERT_MSG(isDeleted(),
98 "tried to restore block %s that is not deleted",
99 toPrettyString());
100
101 // unsetFlag runs setDirty() for us
102 unsetFlag(BLOCK_DELETED);
103 }

◆ setDirty()

template<typename Block >
void altintegration::BlockIndex< Block >::setDirty ( )
inline

Definition at line 229 of file block_index.hpp.

229{ this->dirty = true; }

◆ setFlag()

template<typename Block >
void altintegration::BlockIndex< Block >::setFlag ( enum BlockValidityStatus  s)
inline

Definition at line 233 of file block_index.hpp.

233 {
234 auto newStatus = this->status | s;
235 if (newStatus == this->status) return;
236 this->status = newStatus;
237 setDirty();
238 }

◆ setHeader() [1/2]

template<typename Block >
void altintegration::BlockIndex< Block >::setHeader ( const block_t &  newHeader)
inline

Definition at line 259 of file block_index.hpp.

259 {
260 header = std::make_shared<block_t>(newHeader);
261 setDirty();
262 }

◆ setHeader() [2/2]

template<typename Block >
void altintegration::BlockIndex< Block >::setHeader ( std::shared_ptr< block_t >  newHeader)
inline

Definition at line 263 of file block_index.hpp.

263 {
264 header = std::move(newHeader);
265 setDirty();
266 }

◆ setHeight()

template<typename Block >
void altintegration::BlockIndex< Block >::setHeight ( const height_t  newHeight)
inline

Definition at line 253 of file block_index.hpp.

253 {
254 height = newHeight;
255 setDirty();
256 }

◆ setNull()

template<typename Block >
void altintegration::BlockIndex< Block >::setNull ( )
inline

Definition at line 179 of file block_index.hpp.

179 {
180 addon_t::setNull();
181 this->pprev = nullptr;
182 this->pnext.clear();
183 this->height = 0;
185 // make it dirty by default
186 setDirty();
187 }

◆ setNullInmemFields()

template<typename Block >
void altintegration::BlockIndex< Block >::setNullInmemFields ( )
inline

Definition at line 189 of file block_index.hpp.

189 {
190 addon_t::setNullInmemFields();
191 this->pprev = nullptr;
192 this->pnext.clear();
193 }

◆ setStatus()

template<typename Block >
void altintegration::BlockIndex< Block >::setStatus ( uint32_t  _status)
inline

Definition at line 150 of file block_index.hpp.

150 {
151 if (_status == this->status) return;
152 this->status = _status;
153 setDirty();
154 }

◆ toPrettyString()

template<typename Block >
std::string altintegration::BlockIndex< Block >::toPrettyString ( size_t  level = 0) const
inline

Definition at line 371 of file block_index.hpp.

371 {
372 return format(
373 "{}{}BlockIndex(height={} hash={} prev={} next={} final={} status={} "
374 "{})",
375 std::string(level, ' '),
376 Block::name(),
377 height,
378 HexStr(getHash()),
379 (pprev == nullptr
380 ? "nullptr"
381 : format("{}:{}", pprev->getHeight(), HexStr(pprev->getHash()))),
383 finalized,
384 status,
385 addon_t::toPrettyString());
386 }
std::string HexStr(const T itbegin, const T itend)
Convert bytes to hex.
Definition: strutil.hpp:44
size_t nondeletedDescendantCount() const
Count the descendants that are not deleted.
bool finalized
(memory only) if true, this block can not be reorganized
Definition: block_index.hpp:45

◆ toShortPrettyString()

template<typename Block >
std::string altintegration::BlockIndex< Block >::toShortPrettyString ( ) const
inline

Definition at line 388 of file block_index.hpp.

388 {
389 return format("{}:{}:{}", Block::name(), height, HexStr(getHash()));
390 }

◆ toStoredBlockIndex()

template<typename Block >
StoredBlockIndex< Block > altintegration::BlockIndex< Block >::toStoredBlockIndex ( ) const
inline

Definition at line 131 of file block_index.hpp.

131 {
132 StoredBlockIndex<Block> ret;
133 ret.height = height;
134 ret.status = status;
135 ret.header = header;
136 ret.addon = *this;
137 return ret;
138 }

◆ unsetDirty()

template<typename Block >
void altintegration::BlockIndex< Block >::unsetDirty ( )
inline

Definition at line 230 of file block_index.hpp.

230{ this->dirty = false; }

◆ unsetFlag()

template<typename Block >
void altintegration::BlockIndex< Block >::unsetFlag ( enum BlockValidityStatus  s)
inline

Definition at line 239 of file block_index.hpp.

239 {
240 auto newStatus = this->status & ~s;
241 if (newStatus == this->status) return;
242 this->status = newStatus;
243 setDirty();
244 }

Friends And Related Function Documentation

◆ operator!=

template<typename Block >
bool operator!= ( const BlockIndex< Block > &  a,
const BlockIndex< Block > &  b 
)
friend

Definition at line 397 of file block_index.hpp.

397 {
398 return a.getStatus() != b.getStatus() && a.getHeight() != b.getHeight() &&
399 a.getHeader() != b.getHeader();
400 }

◆ operator==

template<typename Block >
bool operator== ( const BlockIndex< Block > &  a,
const BlockIndex< Block > &  b 
)
friend

Definition at line 392 of file block_index.hpp.

392 {
393 return a.getStatus() == b.getStatus() && a.getHeight() == b.getHeight() &&
394 a.getHeader() == b.getHeader();
395 }

Member Data Documentation

◆ dirty

template<typename Block >
bool altintegration::BlockIndex< Block >::dirty = false
protected

Definition at line 413 of file block_index.hpp.

◆ finalized

template<typename Block >
bool altintegration::BlockIndex< Block >::finalized = false

Definition at line 45 of file block_index.hpp.

◆ header

template<typename Block >
std::shared_ptr<block_t> altintegration::BlockIndex< Block >::header = std::make_shared<block_t>()
protected

Definition at line 407 of file block_index.hpp.

◆ height

template<typename Block >
height_t altintegration::BlockIndex< Block >::height = 0
protected

Definition at line 404 of file block_index.hpp.

◆ pnext

template<typename Block >
std::set<BlockIndex*> altintegration::BlockIndex< Block >::pnext {}

Definition at line 42 of file block_index.hpp.

◆ pprev

template<typename Block >
BlockIndex* altintegration::BlockIndex< Block >::pprev = nullptr

Definition at line 39 of file block_index.hpp.

◆ status

template<typename Block >
uint32_t altintegration::BlockIndex< Block >::status = BLOCK_VALID_UNKNOWN | BLOCK_DELETED
protected

Definition at line 410 of file block_index.hpp.


The documentation for this struct was generated from the following file: