Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeBlockVersion() int32
- func GetStateSinceHeightFor(vc AbstractThresholdConditionChecker, indexPrev *blockindex.BlockIndex, ...) int
- func VersionBitsMask(params *model.BitcoinParams, pos consensus.DeploymentPos) uint32
- func VersionBitsStateSinceHeight(indexPrev *blockindex.BlockIndex, params *model.BitcoinParams, ...) int
- type AbstractThresholdConditionChecker
- type BIP9DeploymentInfo
- type ThresholdConditionCache
- type ThresholdState
- type VersionBitsCache
- type VersionBitsConditionChecker
- func (vc *VersionBitsConditionChecker) BeginTime(params *model.BitcoinParams) int64
- func (vc *VersionBitsConditionChecker) Condition(index *blockindex.BlockIndex, params *model.BitcoinParams) bool
- func (vc *VersionBitsConditionChecker) EndTime(params *model.BitcoinParams) int64
- func (vc *VersionBitsConditionChecker) Mask(params *model.BitcoinParams) int32
- func (vc *VersionBitsConditionChecker) Period(params *model.BitcoinParams) int
- func (vc *VersionBitsConditionChecker) Threshold(params *model.BitcoinParams) int
Constants ¶
View Source
const ( // VersionBitsLastOldBlockVersion what block version to use for new blocks (pre versionBits) VersionBitsLastOldBlockVersion = 4 // VersionBitsTopBits what bits to set in version for versionBits blocks VersionBitsTopBits = 0x20000000 // VersionBitsTopMask What bitMask determines whether versionBits is in use VersionBitsTopMask int64 = 0xE0000000 // VersionBitsNumBits Total bits available for versionBits VersionBitsNumBits = 29 )
Variables ¶
View Source
var VersionBitsDeploymentInfo = []BIP9DeploymentInfo{ { Name: "testdummy", GbtForce: true, }, { Name: "csv", GbtForce: true, }, }
Functions ¶
func ComputeBlockVersion ¶
func ComputeBlockVersion() int32
func GetStateSinceHeightFor ¶
func GetStateSinceHeightFor(vc AbstractThresholdConditionChecker, indexPrev *blockindex.BlockIndex, params *model.BitcoinParams, cache ThresholdConditionCache) int
func VersionBitsMask ¶
func VersionBitsMask(params *model.BitcoinParams, pos consensus.DeploymentPos) uint32
func VersionBitsStateSinceHeight ¶
func VersionBitsStateSinceHeight(indexPrev *blockindex.BlockIndex, params *model.BitcoinParams, pos consensus.DeploymentPos, vbc *VersionBitsCache) int
Types ¶
type AbstractThresholdConditionChecker ¶
type AbstractThresholdConditionChecker interface { Condition(index *blockindex.BlockIndex, params *model.BitcoinParams) bool BeginTime(params *model.BitcoinParams) int64 EndTime(params *model.BitcoinParams) int64 Period(params *model.BitcoinParams) int Threshold(params *model.BitcoinParams) int }
type BIP9DeploymentInfo ¶
type ThresholdConditionCache ¶
type ThresholdConditionCache map[*blockindex.BlockIndex]ThresholdState
func NewWarnBitsCache ¶
func NewWarnBitsCache(bitNum int) []ThresholdConditionCache
type ThresholdState ¶
type ThresholdState int
const ( ThresholdDefined ThresholdState = iota ThresholdStarted ThresholdLockedIn ThresholdActive ThresholdFailed )
func GetStateFor ¶
func GetStateFor(vc AbstractThresholdConditionChecker, indexPrev *blockindex.BlockIndex, params *model.BitcoinParams, cache ThresholdConditionCache) ThresholdState
func VersionBitsState ¶
func VersionBitsState(indexPrev *blockindex.BlockIndex, params *model.BitcoinParams, pos consensus.DeploymentPos, vbc *VersionBitsCache) ThresholdState
type VersionBitsCache ¶
var VBCache *VersionBitsCache // todo waring: there is a global variable(used as cache)
func NewVersionBitsCache ¶
func NewVersionBitsCache() *VersionBitsCache
func (*VersionBitsCache) Clear ¶
func (vbc *VersionBitsCache) Clear()
type VersionBitsConditionChecker ¶
type VersionBitsConditionChecker struct {
// contains filtered or unexported fields
}
func (*VersionBitsConditionChecker) BeginTime ¶
func (vc *VersionBitsConditionChecker) BeginTime(params *model.BitcoinParams) int64
func (*VersionBitsConditionChecker) Condition ¶
func (vc *VersionBitsConditionChecker) Condition(index *blockindex.BlockIndex, params *model.BitcoinParams) bool
func (*VersionBitsConditionChecker) EndTime ¶
func (vc *VersionBitsConditionChecker) EndTime(params *model.BitcoinParams) int64
func (*VersionBitsConditionChecker) Mask ¶
func (vc *VersionBitsConditionChecker) Mask(params *model.BitcoinParams) int32
func (*VersionBitsConditionChecker) Period ¶
func (vc *VersionBitsConditionChecker) Period(params *model.BitcoinParams) int
func (*VersionBitsConditionChecker) Threshold ¶
func (vc *VersionBitsConditionChecker) Threshold(params *model.BitcoinParams) int
Click to show internal directories.
Click to hide internal directories.