veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
|
A node in a block tree. More...
Block |
Definition at line 31 of file block_index.hpp.
#include <block_index.hpp>
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 | |
BlockIndex & | operator= (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 BlockIndex * | getAncestorBlocksBehind (height_t steps) const |
const BlockIndex * | getPrev () const |
BlockIndex * | getPrev () |
bool | isDescendantOf (const BlockIndex &ancestor) const |
bool | isAncestorOf (const BlockIndex &descendant) const |
const BlockIndex * | getAncestor (height_t _height) const |
BlockIndex * | getAncestor (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 | |
BlockIndex * | pprev = 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) |
using altintegration::BlockIndex< Block >::addon_t = typename Block::addon_t |
Definition at line 33 of file block_index.hpp.
using altintegration::BlockIndex< Block >::block_t = Block |
Definition at line 32 of file block_index.hpp.
using altintegration::BlockIndex< Block >::hash_t = typename block_t::hash_t |
Definition at line 34 of file block_index.hpp.
using altintegration::BlockIndex< Block >::height_t = typename block_t::height_t |
Definition at line 36 of file block_index.hpp.
using altintegration::BlockIndex< Block >::prev_hash_t = typename block_t::prev_hash_t |
Definition at line 35 of file block_index.hpp.
|
inline |
Definition at line 48 of file block_index.hpp.
|
inlineexplicit |
Definition at line 64 of file block_index.hpp.
|
inline |
Definition at line 66 of file block_index.hpp.
|
inline |
Definition at line 286 of file block_index.hpp.
|
inline |
Definition at line 306 of file block_index.hpp.
|
inline |
Definition at line 268 of file block_index.hpp.
|
inline |
Definition at line 105 of file block_index.hpp.
|
inline |
|
inline |
Definition at line 366 of file block_index.hpp.
|
inline |
_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.
|
inline |
Definition at line 313 of file block_index.hpp.
|
inline |
Definition at line 250 of file block_index.hpp.
|
inline |
Definition at line 248 of file block_index.hpp.
|
inline |
Definition at line 258 of file block_index.hpp.
|
inline |
Definition at line 252 of file block_index.hpp.
|
inline |
Definition at line 331 of file block_index.hpp.
|
inline |
Definition at line 321 of file block_index.hpp.
|
inline |
Definition at line 149 of file block_index.hpp.
|
inline |
Definition at line 249 of file block_index.hpp.
|
inline |
Definition at line 156 of file block_index.hpp.
|
inline |
Definition at line 246 of file block_index.hpp.
|
inline |
Definition at line 340 of file block_index.hpp.
|
inlinenoexcept |
Definition at line 145 of file block_index.hpp.
|
inline |
Definition at line 93 of file block_index.hpp.
|
inline |
Definition at line 336 of file block_index.hpp.
|
inline |
Definition at line 231 of file block_index.hpp.
|
inline |
Definition at line 162 of file block_index.hpp.
|
inline |
Definition at line 94 of file block_index.hpp.
|
inline |
Definition at line 84 of file block_index.hpp.
|
inline |
Definition at line 164 of file block_index.hpp.
|
inline |
Definition at line 275 of file block_index.hpp.
|
inline |
Definition at line 168 of file block_index.hpp.
|
inline |
Definition at line 214 of file block_index.hpp.
|
inline |
Definition at line 123 of file block_index.hpp.
|
inline |
Definition at line 296 of file block_index.hpp.
|
inline |
Definition at line 195 of file block_index.hpp.
|
inline |
Definition at line 96 of file block_index.hpp.
|
inline |
Definition at line 229 of file block_index.hpp.
|
inline |
Definition at line 233 of file block_index.hpp.
|
inline |
Definition at line 259 of file block_index.hpp.
|
inline |
Definition at line 263 of file block_index.hpp.
|
inline |
Definition at line 253 of file block_index.hpp.
|
inline |
Definition at line 179 of file block_index.hpp.
|
inline |
Definition at line 189 of file block_index.hpp.
|
inline |
Definition at line 150 of file block_index.hpp.
|
inline |
Definition at line 371 of file block_index.hpp.
|
inline |
Definition at line 388 of file block_index.hpp.
|
inline |
Definition at line 131 of file block_index.hpp.
|
inline |
Definition at line 230 of file block_index.hpp.
|
inline |
Definition at line 239 of file block_index.hpp.
|
friend |
Definition at line 397 of file block_index.hpp.
|
friend |
Definition at line 392 of file block_index.hpp.
|
protected |
Definition at line 413 of file block_index.hpp.
bool altintegration::BlockIndex< Block >::finalized = false |
Definition at line 45 of file block_index.hpp.
|
protected |
Definition at line 407 of file block_index.hpp.
|
protected |
Definition at line 404 of file block_index.hpp.
std::set<BlockIndex*> altintegration::BlockIndex< Block >::pnext {} |
Definition at line 42 of file block_index.hpp.
BlockIndex* altintegration::BlockIndex< Block >::pprev = nullptr |
Definition at line 39 of file block_index.hpp.
|
protected |
Definition at line 410 of file block_index.hpp.