Bitcoin Core  22.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
VersionBitsCache Class Reference

BIP 9 allows multiple softforks to be deployed in parallel. More...

#include <versionbits.h>

Collaboration diagram for VersionBitsCache:
[legend]

Public Member Functions

ThresholdState State (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos)
 Get the BIP9 state for a given deployment for the block after pindexPrev. More...
 
int StateSinceHeight (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos)
 Get the block height at which the BIP9 deployment switched into the state for the block after pindexPrev. More...
 
int32_t ComputeBlockVersion (const CBlockIndex *pindexPrev, const Consensus::Params &params)
 Determine what nVersion a new block should use. More...
 
void Clear ()
 

Static Public Member Functions

static BIP9Stats Statistics (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos)
 Get the numerical statistics for a given deployment for the signalling period that includes the block after pindexPrev. More...
 
static uint32_t Mask (const Consensus::Params &params, Consensus::DeploymentPos pos)
 

Private Member Functions

ThresholdConditionCache m_caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTSGUARDED_BY (m_mutex)
 

Private Attributes

Mutex m_mutex
 

Detailed Description

BIP 9 allows multiple softforks to be deployed in parallel.

We cache per-period state for every one of them.

Definition at line 78 of file versionbits.h.

Member Function Documentation

◆ Clear()

void VersionBitsCache::Clear ( )

Definition at line 231 of file versionbits.cpp.

Here is the caller graph for this function:

◆ ComputeBlockVersion()

int32_t VersionBitsCache::ComputeBlockVersion ( const CBlockIndex pindexPrev,
const Consensus::Params params 
)

Determine what nVersion a new block should use.

Definition at line 215 of file versionbits.cpp.

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

◆ GUARDED_BY()

ThresholdConditionCache m_caches [Consensus::MAX_VERSION_BITS_DEPLOYMENTS] VersionBitsCache::GUARDED_BY ( m_mutex  )
private

◆ Mask()

uint32_t VersionBitsCache::Mask ( const Consensus::Params params,
Consensus::DeploymentPos  pos 
)
static

Definition at line 210 of file versionbits.cpp.

Here is the caller graph for this function:

◆ State()

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

Get the BIP9 state for a given deployment for the block after pindexPrev.

Definition at line 193 of file versionbits.cpp.

Here is the caller graph for this function:

◆ StateSinceHeight()

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

Get the block height at which the BIP9 deployment switched into the state for the block after pindexPrev.

Definition at line 204 of file versionbits.cpp.

Here is the caller graph for this function:

◆ Statistics()

BIP9Stats VersionBitsCache::Statistics ( const CBlockIndex pindexPrev,
const Consensus::Params params,
Consensus::DeploymentPos  pos 
)
static

Get the numerical statistics for a given deployment for the signalling period that includes the block after pindexPrev.

Definition at line 199 of file versionbits.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_mutex

Mutex VersionBitsCache::m_mutex
private

Definition at line 81 of file versionbits.h.


The documentation for this class was generated from the following files: