Bitcoin ABC 0.30.7
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 set, this indicates that the block index entry is assumed-valid. 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 52 of file blockstatus.h.

Here is the caller graph for this function:

Member Function Documentation

◆ getValidity()

BlockValidity BlockStatus::getValidity ( ) const
inline

Definition at line 54 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasData()

bool BlockStatus::hasData ( ) const
inline

Definition at line 62 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasFailed()

bool BlockStatus::hasFailed ( ) const
inline

Definition at line 74 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasFailedParent()

bool BlockStatus::hasFailedParent ( ) const
inline

Definition at line 80 of file blockstatus.h.

Here is the caller graph for this function:

◆ hasParkedParent()

bool BlockStatus::hasParkedParent ( ) const
inline

Definition at line 92 of file blockstatus.h.

◆ hasUndo()

bool BlockStatus::hasUndo ( ) const
inline

Definition at line 68 of file blockstatus.h.

Here is the caller graph for this function:

◆ isAssumedValid()

bool BlockStatus::isAssumedValid ( ) const
inline

Definition at line 110 of file blockstatus.h.

◆ isInvalid()

bool BlockStatus::isInvalid ( ) const
inline

Definition at line 119 of file blockstatus.h.

Here is the caller graph for this function:

◆ isOnParkedChain()

bool BlockStatus::isOnParkedChain ( ) const
inline

Definition at line 124 of file blockstatus.h.

◆ isParked()

bool BlockStatus::isParked ( ) const
inline

Definition at line 86 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 102 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 129 of file blockstatus.h.

◆ withAssumedValid()

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

Definition at line 111 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedAssumedValidFlags()

BlockStatus BlockStatus::withClearedAssumedValidFlags ( ) const
inline

Definition at line 115 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedFailureFlags()

BlockStatus BlockStatus::withClearedFailureFlags ( ) const
inline

Definition at line 120 of file blockstatus.h.

Here is the call graph for this function:

◆ withClearedParkedFlags()

BlockStatus BlockStatus::withClearedParkedFlags ( ) const
inline

Definition at line 125 of file blockstatus.h.

Here is the call graph for this function:

◆ withData()

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

Definition at line 63 of file blockstatus.h.

Here is the call graph for this function:

◆ withFailed()

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

Definition at line 75 of file blockstatus.h.

Here is the call graph for this function:

◆ withFailedParent()

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

Definition at line 81 of file blockstatus.h.

Here is the call graph for this function:

◆ withParked()

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

Definition at line 87 of file blockstatus.h.

Here is the call graph for this function:

◆ withParkedParent()

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

Definition at line 93 of file blockstatus.h.

Here is the call graph for this function:

◆ withUndo()

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

Definition at line 69 of file blockstatus.h.

Here is the call graph for this function:

◆ withValidity()

BlockStatus BlockStatus::withValidity ( BlockValidity  validity) const
inline

Definition at line 58 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 135 of file blockstatus.h.

◆ operator==

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

Definition at line 131 of file blockstatus.h.

Member Data Documentation

◆ ASSUMED_VALID_FLAG

const uint32_t BlockStatus::ASSUMED_VALID_FLAG = 0x200
staticprivate

If set, this indicates that the block index entry is assumed-valid.

Certain diagnostics will be skipped in e.g. CheckBlockIndex(). It almost certainly means that the block's full validation is pending on a background chainstate.

Definition at line 49 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: