Bitcoin Core 29.99.0
P2P Digital Currency
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

BIP9Info Info (const CBlockIndex &block_index, const Consensus::Params &params, Consensus::DeploymentPos id) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 
BIP9GBTStatus GBTStatus (const CBlockIndex &block_index, const Consensus::Params &params) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 
bool IsActiveAfter (const CBlockIndex *pindexPrev, const Consensus::Params &params, Consensus::DeploymentPos pos) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Get the BIP9 state for a given deployment for the block after pindexPrev. More...
 
int32_t ComputeBlockVersion (const CBlockIndex *pindexPrev, const Consensus::Params &params) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Determine what nVersion a new block should use. More...
 
std::vector< std::pair< int, bool > > CheckUnknownActivations (const CBlockIndex *pindex, const CChainParams &chainparams) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 Check for unknown activations Returns a vector containing the bit number used for signalling and a bool indicating the deployment is likely to be ACTIVE, rather than merely LOCKED_IN. More...
 
void Clear () EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
 

Private Member Functions

std::array< ThresholdConditionCache, VERSIONBITS_NUM_BITS > m_warning_caches GUARDED_BY (m_mutex)
 
std::array< ThresholdConditionCache, Consensus::MAX_VERSION_BITS_DEPLOYMENTS > m_caches GUARDED_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 76 of file versionbits.h.

Member Function Documentation

◆ CheckUnknownActivations()

std::vector< std::pair< int, bool > > VersionBitsCache::CheckUnknownActivations ( const CBlockIndex pindex,
const CChainParams chainparams 
)

Check for unknown activations Returns a vector containing the bit number used for signalling and a bool indicating the deployment is likely to be ACTIVE, rather than merely LOCKED_IN.

Definition at line 333 of file versionbits.cpp.

◆ Clear()

void VersionBitsCache::Clear ( )

Definition at line 287 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 281 of file versionbits.cpp.

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

◆ GBTStatus()

BIP9GBTStatus VersionBitsCache::GBTStatus ( const CBlockIndex block_index,
const Consensus::Params params 
)

Definition at line 228 of file versionbits.cpp.

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

◆ GUARDED_BY() [1/2]

std::array< ThresholdConditionCache, VERSIONBITS_NUM_BITS > m_warning_caches VersionBitsCache::GUARDED_BY ( m_mutex  )
private

◆ GUARDED_BY() [2/2]

std::array< ThresholdConditionCache, Consensus::MAX_VERSION_BITS_DEPLOYMENTS > m_caches VersionBitsCache::GUARDED_BY ( m_mutex  )
private

◆ Info()

BIP9Info VersionBitsCache::Info ( const CBlockIndex block_index,
const Consensus::Params params,
Consensus::DeploymentPos  id 
)

Definition at line 192 of file versionbits.cpp.

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

◆ IsActiveAfter()

bool VersionBitsCache::IsActiveAfter ( 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 259 of file versionbits.cpp.

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

Member Data Documentation

◆ m_mutex

Mutex VersionBitsCache::m_mutex
private

Definition at line 79 of file versionbits.h.


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