Bitcoin Core  0.18.99
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions | Variables
versionbits.h File Reference
#include <chain.h>
#include <map>
Include dependency graph for versionbits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  BIP9Stats
 Display status of an in-progress BIP9 softfork. More...
 
class  AbstractThresholdConditionChecker
 Abstract class that implements BIP9-style threshold logic, and caches results. More...
 
struct  VersionBitsCache
 BIP 9 allows multiple softforks to be deployed in parallel. More...
 

Typedefs

typedef std::map< const CBlockIndex *, ThresholdStateThresholdConditionCache
 

Enumerations

enum  ThresholdState {
  ThresholdState::DEFINED, ThresholdState::STARTED, ThresholdState::LOCKED_IN, ThresholdState::ACTIVE,
  ThresholdState::FAILED
}
 BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages. More...
 

Functions

ThresholdState VersionBitsState (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos, VersionBitsCache &cache)
 
BIP9Stats VersionBitsStatistics (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos)
 
int VersionBitsStateSinceHeight (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos, VersionBitsCache &cache)
 
uint32_t VersionBitsMask (const Consensus::Params &params, Consensus::DeploymentPos pos)
 

Variables

static const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
 What block version to use for new blocks (pre versionbits) More...
 
static const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL
 What bits to set in version for versionbits blocks. More...
 
static const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL
 What bitmask determines whether versionbits is in use. More...
 
static const int32_t VERSIONBITS_NUM_BITS = 29
 Total bits available for versionbits. More...
 

Typedef Documentation

◆ ThresholdConditionCache

Definition at line 36 of file versionbits.h.

Enumeration Type Documentation

◆ ThresholdState

enum ThresholdState
strong

BIP 9 defines a finite-state-machine to deploy a softfork in multiple stages.

State transitions happen during retarget period if conditions are met In case of reorg, transitions can go backward. Without transition, state is inherited between periods. All blocks of a period share the same state.

Enumerator
DEFINED 
STARTED 
LOCKED_IN 
ACTIVE 
FAILED 

Definition at line 25 of file versionbits.h.

Function Documentation

◆ VersionBitsMask()

uint32_t VersionBitsMask ( const Consensus::Params params,
Consensus::DeploymentPos  pos 
)

Definition at line 203 of file versionbits.cpp.

Here is the caller graph for this function:

◆ VersionBitsState()

ThresholdState VersionBitsState ( const CBlockIndex pindexPrev,
const Consensus::Params params,
Consensus::DeploymentPos  pos,
VersionBitsCache cache 
)

Definition at line 188 of file versionbits.cpp.

Here is the caller graph for this function:

◆ VersionBitsStateSinceHeight()

int VersionBitsStateSinceHeight ( const CBlockIndex pindexPrev,
const Consensus::Params params,
Consensus::DeploymentPos  pos,
VersionBitsCache cache 
)

Definition at line 198 of file versionbits.cpp.

Here is the caller graph for this function:

◆ VersionBitsStatistics()

BIP9Stats VersionBitsStatistics ( const CBlockIndex pindexPrev,
const Consensus::Params params,
Consensus::DeploymentPos  pos 
)

Definition at line 193 of file versionbits.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ VERSIONBITS_LAST_OLD_BLOCK_VERSION

const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
static

What block version to use for new blocks (pre versionbits)

Definition at line 12 of file versionbits.h.

◆ VERSIONBITS_NUM_BITS

const int32_t VERSIONBITS_NUM_BITS = 29
static

Total bits available for versionbits.

Definition at line 18 of file versionbits.h.

◆ VERSIONBITS_TOP_BITS

const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL
static

What bits to set in version for versionbits blocks.

Definition at line 14 of file versionbits.h.

◆ VERSIONBITS_TOP_MASK

const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL
static

What bitmask determines whether versionbits is in use.

Definition at line 16 of file versionbits.h.