Bitcoin ABC 0.30.9
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
BlockStatus Struct Reference

#include <blockstatus.h>

Public Member Functions

constexpr BlockStatus ()
 
BlockValidity getValidity () const
 
BlockStatus withValidity (BlockValidity validity) const
 
bool hasData () const
 
BlockStatus withData (bool hasData=true) const
 
bool hasUndo () const
 
BlockStatus withUndo (bool hasUndo=true) const
 
bool hasFailed () const
 
BlockStatus withFailed (bool hasFailed=true) const
 
bool hasFailedParent () const
 
BlockStatus withFailedParent (bool hasFailedParent=true) const
 
bool isParked () const
 
BlockStatus withParked (bool parked=true) const
 
bool hasParkedParent () const
 
BlockStatus withParkedParent (bool parkedParent=true) const
 
bool isValid (enum BlockValidity nUpTo=BlockValidity::TRANSACTIONS) const
 Check whether this block index entry is valid up to the passed validity level. More...
 
bool isAssumedValid () const
 
BlockStatus withAssumedValid (bool assumed_valid=true) const
 
BlockStatus withClearedAssumedValidFlags () const
 
bool isInvalid () const
 
BlockStatus withClearedFailureFlags () const
 
bool isOnParkedChain () const
 
BlockStatus withClearedParkedFlags () const
 
 SERIALIZE_METHODS (BlockStatus, obj)
 

Private Member Functions

constexpr BlockStatus (uint32_t nStatusIn)
 

Private Attributes

uint32_t status
 

Static Private Attributes

static const uint32_t VALIDITY_MASK = 0x07
 
static const uint32_t HAS_DATA_FLAG = 0x08
 
static const uint32_t HAS_UNDO_FLAG = 0x10
 
static const uint32_t FAILED_FLAG = 0x20
 
static const uint32_t FAILED_PARENT_FLAG = 0x40
 
static const uint32_t INVALID_MASK = FAILED_FLAG | FAILED_PARENT_FLAG
 
static const uint32_t PARKED_FLAG = 0x80
 
static const uint32_t PARKED_PARENT_FLAG = 0x100
 
static const uint32_t PARKED_MASK = PARKED_FLAG | PARKED_PARENT_FLAG
 
static const uint32_t ASSUMED_VALID_FLAG = 0x200
 If ASSUMED_VALID_FLAG is set, it means that this block has not been validated and has validity status less than VALID_SCRIPTS. More...
 

Friends

constexpr bool operator== (const BlockStatus a, const BlockStatus b)
 
constexpr bool operator!= (const BlockStatus a, const BlockStatus b)
 

Detailed Description

Definition at line 13 of file blockstatus.h.

Constructor & Destructor Documentation

◆ BlockStatus() [1/2]

constexpr BlockStatus::BlockStatus ( uint32_t  nStatusIn)
inlineexplicitconstexprprivate

Definition at line 17 of file blockstatus.h.

◆ BlockStatus() [2/2]

constexpr BlockStatus::BlockStatus ( )
inlineexplicitconstexpr

Definition at line 61 of file blockstatus.h.

Here is the caller graph for this function:

Member Function Documentation

◆ getValidity()

BlockValidity BlockStatus::getValidity ( ) const
inline

Definition at line 63 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasData()

bool BlockStatus::hasData ( ) const
inline

Definition at line 71 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasFailed()

bool BlockStatus::hasFailed ( ) const
inline

Definition at line 83 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasFailedParent()

bool BlockStatus::hasFailedParent ( ) const
inline

Definition at line 89 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasParkedParent()

bool BlockStatus::hasParkedParent ( ) const
inline

Definition at line 101 of file blockstatus.h.

◆ hasUndo()

bool BlockStatus::hasUndo ( ) const
inline

Definition at line 77 of file blockstatus.h.

Here is the caller graph for this function:

◆ isAssumedValid()

bool BlockStatus::isAssumedValid ( ) const
inline

Definition at line 119 of file blockstatus.h.

◆ isInvalid()

bool BlockStatus::isInvalid ( ) const
inline

Definition at line 128 of file blockstatus.h.

Here is the caller graph for this function:

◆ isOnParkedChain()

bool BlockStatus::isOnParkedChain ( ) const
inline

Definition at line 133 of file blockstatus.h.

◆ isParked()

bool BlockStatus::isParked ( ) const
inline

Definition at line 95 of file blockstatus.h.

◆ isValid()

bool BlockStatus::isValid ( enum BlockValidity  nUpTo = BlockValidity::TRANSACTIONS) const
inline

Check whether this block index entry is valid up to the passed validity level.

Definition at line 111 of file blockstatus.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SERIALIZE_METHODS()

BlockStatus::SERIALIZE_METHODS ( BlockStatus  ,
obj   
)
inline

Definition at line 138 of file blockstatus.h.

◆ withAssumedValid()

BlockStatus BlockStatus::withAssumedValid ( bool  assumed_valid = true) const
inline

Definition at line 120 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedAssumedValidFlags()

BlockStatus BlockStatus::withClearedAssumedValidFlags ( ) const
inline

Definition at line 124 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedFailureFlags()

BlockStatus BlockStatus::withClearedFailureFlags ( ) const
inline

Definition at line 129 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedParkedFlags()

BlockStatus BlockStatus::withClearedParkedFlags ( ) const
inline

Definition at line 134 of file blockstatus.h.

Here is the call graph for this function:

◆ withData()

BlockStatus BlockStatus::withData ( bool  hasData = true) const
inline

Definition at line 72 of file blockstatus.h.

Here is the call graph for this function:

◆ withFailed()

BlockStatus BlockStatus::withFailed ( bool  hasFailed = true) const
inline

Definition at line 84 of file blockstatus.h.

Here is the call graph for this function:

◆ withFailedParent()

BlockStatus BlockStatus::withFailedParent ( bool  hasFailedParent = true) const
inline

Definition at line 90 of file blockstatus.h.

Here is the call graph for this function:

◆ withParked()

BlockStatus BlockStatus::withParked ( bool  parked = true) const
inline

Definition at line 96 of file blockstatus.h.

Here is the call graph for this function:

◆ withParkedParent()

BlockStatus BlockStatus::withParkedParent ( bool  parkedParent = true) const
inline

Definition at line 102 of file blockstatus.h.

Here is the call graph for this function:

◆ withUndo()

BlockStatus BlockStatus::withUndo ( bool  hasUndo = true) const
inline

Definition at line 78 of file blockstatus.h.

Here is the call graph for this function:

◆ withValidity()

BlockStatus BlockStatus::withValidity ( BlockValidity  validity) const
inline

Definition at line 67 of file blockstatus.h.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator!=

constexpr bool operator!= ( const BlockStatus  a,
const BlockStatus  b 
)
friend

Definition at line 144 of file blockstatus.h.

◆ operator==

constexpr bool operator== ( const BlockStatus  a,
const BlockStatus  b 
)
friend

Definition at line 140 of file blockstatus.h.

Member Data Documentation

◆ ASSUMED_VALID_FLAG

const uint32_t BlockStatus::ASSUMED_VALID_FLAG = 0x200
staticprivate

If ASSUMED_VALID_FLAG is set, it means that this block has not been validated and has validity status less than VALID_SCRIPTS.

Also that it may have descendant blocks with VALID_SCRIPTS set, because they can be validated based on an assumeutxo snapshot.

When an assumeutxo snapshot is loaded, the ASSUMED_VALID flag is added to unvalidated blocks at the snapshot height and below. Then, as the background validation progresses, and these blocks are validated, the ASSUMED_VALID flags are removed. See doc/design/assumeutxo.md for details.

This flag is only used to implement checks in CheckBlockIndex() and should not be used elsewhere.

Definition at line 58 of file blockstatus.h.

◆ FAILED_FLAG

const uint32_t BlockStatus::FAILED_FLAG = 0x20
staticprivate

Definition at line 27 of file blockstatus.h.

◆ FAILED_PARENT_FLAG

const uint32_t BlockStatus::FAILED_PARENT_FLAG = 0x40
staticprivate

Definition at line 29 of file blockstatus.h.

◆ HAS_DATA_FLAG

const uint32_t BlockStatus::HAS_DATA_FLAG = 0x08
staticprivate

Definition at line 22 of file blockstatus.h.

◆ HAS_UNDO_FLAG

const uint32_t BlockStatus::HAS_UNDO_FLAG = 0x10
staticprivate

Definition at line 24 of file blockstatus.h.

◆ INVALID_MASK

const uint32_t BlockStatus::INVALID_MASK = FAILED_FLAG | FAILED_PARENT_FLAG
staticprivate

Definition at line 32 of file blockstatus.h.

◆ PARKED_FLAG

const uint32_t BlockStatus::PARKED_FLAG = 0x80
staticprivate

Definition at line 36 of file blockstatus.h.

◆ PARKED_MASK

const uint32_t BlockStatus::PARKED_MASK = PARKED_FLAG | PARKED_PARENT_FLAG
staticprivate

Definition at line 41 of file blockstatus.h.

◆ PARKED_PARENT_FLAG

const uint32_t BlockStatus::PARKED_PARENT_FLAG = 0x100
staticprivate

Definition at line 38 of file blockstatus.h.

◆ status

uint32_t BlockStatus::status
private

Definition at line 15 of file blockstatus.h.

◆ VALIDITY_MASK

const uint32_t BlockStatus::VALIDITY_MASK = 0x07
staticprivate

Definition at line 19 of file blockstatus.h.


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