Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Protected Member Functions | List of all members
AbstractThresholdConditionChecker Class Referenceabstract

Abstract class that implements BIP9-style threshold logic, and caches results. More...

#include <versionbits.h>

Inheritance diagram for AbstractThresholdConditionChecker:
[legend]

Public Member Functions

BIP9Stats GetStateStatisticsFor (const CBlockIndex *pindex, const Consensus::Params &params, std::vector< bool > *signalling_blocks=nullptr) const
 Returns the numerical statistics of an in-progress BIP9 softfork in the period including pindex If provided, signalling_blocks is set to true/false based on whether each block in the period signalled. More...
 
ThresholdState GetStateFor (const CBlockIndex *pindexPrev, const Consensus::Params &params, ThresholdConditionCache &cache) const
 Returns the state for pindex A based on parent pindexPrev B. More...
 
int GetStateSinceHeightFor (const CBlockIndex *pindexPrev, const Consensus::Params &params, ThresholdConditionCache &cache) const
 Returns the height since when the ThresholdState has started for pindex A based on parent pindexPrev B, all blocks of a period share the same. More...
 

Protected Member Functions

virtual bool Condition (const CBlockIndex *pindex, const Consensus::Params &params) const =0
 
virtual int64_t BeginTime (const Consensus::Params &params) const =0
 
virtual int64_t EndTime (const Consensus::Params &params) const =0
 
virtual int MinActivationHeight (const Consensus::Params &params) const
 
virtual int Period (const Consensus::Params &params) const =0
 
virtual int Threshold (const Consensus::Params &params) const =0
 

Detailed Description

Abstract class that implements BIP9-style threshold logic, and caches results.

Definition at line 57 of file versionbits.h.

Member Function Documentation

◆ BeginTime()

virtual int64_t AbstractThresholdConditionChecker::BeginTime ( const Consensus::Params params) const
protectedpure virtual

Implemented in TestConditionChecker, TestAlwaysActiveConditionChecker, TestNeverActiveConditionChecker, and WarningBitsConditionChecker.

Here is the caller graph for this function:

◆ Condition()

virtual bool AbstractThresholdConditionChecker::Condition ( const CBlockIndex pindex,
const Consensus::Params params 
) const
protectedpure virtual

Implemented in TestConditionChecker, and WarningBitsConditionChecker.

Here is the caller graph for this function:

◆ EndTime()

virtual int64_t AbstractThresholdConditionChecker::EndTime ( const Consensus::Params params) const
protectedpure virtual

Implemented in TestConditionChecker, and WarningBitsConditionChecker.

Here is the caller graph for this function:

◆ GetStateFor()

ThresholdState AbstractThresholdConditionChecker::GetStateFor ( const CBlockIndex pindexPrev,
const Consensus::Params params,
ThresholdConditionCache cache 
) const

Returns the state for pindex A based on parent pindexPrev B.

Applies any state transition if conditions are present. Caches state from first block of period.

Definition at line 9 of file versionbits.cpp.

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

◆ GetStateSinceHeightFor()

int AbstractThresholdConditionChecker::GetStateSinceHeightFor ( const CBlockIndex pindexPrev,
const Consensus::Params params,
ThresholdConditionCache cache 
) const

Returns the height since when the ThresholdState has started for pindex A based on parent pindexPrev B, all blocks of a period share the same.

Definition at line 140 of file versionbits.cpp.

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

◆ GetStateStatisticsFor()

BIP9Stats AbstractThresholdConditionChecker::GetStateStatisticsFor ( const CBlockIndex pindex,
const Consensus::Params params,
std::vector< bool > *  signalling_blocks = nullptr 
) const

Returns the numerical statistics of an in-progress BIP9 softfork in the period including pindex If provided, signalling_blocks is set to true/false based on whether each block in the period signalled.

Definition at line 102 of file versionbits.cpp.

Here is the call graph for this function:

◆ MinActivationHeight()

virtual int AbstractThresholdConditionChecker::MinActivationHeight ( const Consensus::Params params) const
inlineprotectedvirtual

Reimplemented in TestDelayedActivationConditionChecker.

Definition at line 62 of file versionbits.h.

Here is the caller graph for this function:

◆ Period()

virtual int AbstractThresholdConditionChecker::Period ( const Consensus::Params params) const
protectedpure virtual

Implemented in TestConditionChecker, and WarningBitsConditionChecker.

Here is the caller graph for this function:

◆ Threshold()

virtual int AbstractThresholdConditionChecker::Threshold ( const Consensus::Params params) const
protectedpure virtual

Implemented in TestConditionChecker, and WarningBitsConditionChecker.

Here is the caller graph for this function:

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