versionbits

package
v0.0.0-...-e2b9c72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2018 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

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(indexPrev *blockindex.BlockIndex, params *chainparams.BitcoinParams, t *VersionBitsCache) int

func VersionBitsMask

func VersionBitsMask(params *chainparams.BitcoinParams, pos consensus.DeploymentPos) uint32

func VersionBitsStateSinceHeight

func VersionBitsStateSinceHeight(indexPrev *blockindex.BlockIndex, params *chainparams.BitcoinParams, pos consensus.DeploymentPos, vbc *VersionBitsCache) int

Types

type AbstractThresholdConditionChecker

type AbstractThresholdConditionChecker interface {
	Condition(index *blockindex.BlockIndex, params *chainparams.BitcoinParams) bool
	BeginTime(params *chainparams.BitcoinParams) int64
	EndTime(params *chainparams.BitcoinParams) int64
	Period(params *chainparams.BitcoinParams) int
	Threshold(params *chainparams.BitcoinParams) int
}

type BIP9DeploymentInfo

type BIP9DeploymentInfo struct {
	Name     string
	GbtForce bool
}

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
)

type VersionBitsCache

type VersionBitsCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}
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 (*VersionBitsConditionChecker) Condition

func (*VersionBitsConditionChecker) EndTime

func (*VersionBitsConditionChecker) Mask

func (*VersionBitsConditionChecker) Period

func (*VersionBitsConditionChecker) Threshold

type WarningBitsConditionChecker

type WarningBitsConditionChecker struct {
	// contains filtered or unexported fields
}

func NewWarningBitsConChecker

func NewWarningBitsConChecker(bitIn int) *WarningBitsConditionChecker

func (*WarningBitsConditionChecker) BeginTime

func (*WarningBitsConditionChecker) Condition

func (*WarningBitsConditionChecker) EndTime

func (*WarningBitsConditionChecker) Period

func (*WarningBitsConditionChecker) Threshold

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL