Documentation ¶
Index ¶
- Constants
- func ForkSortFunc(a, b *Fork) int
- type Fork
- type Forks
- func (fs *Forks) ActivatedBy(height uint64) []*Fork
- func (fs *Forks) ActivatesAt(height uint64) []string
- func (fs *Forks) BeginsHalt(height uint64) bool
- func (fs *Forks) ForkHeight(fork string) *uint64
- func (fs *Forks) FromMap(forks map[string]*uint64)
- func (fs *Forks) IsHalt(height uint64) bool
- func (fs Forks) String() string
Constants ¶
const ( // ForkHalt is kiss-of-death fork, after which no transactions are included // in blocks, and all transactions are evicted from mempool. There are no // other changes that are sensible for a traditional consensus update. The // only conceivable use for this is a network migration where there should // be no transactions after the genesis data snapshot is collected for the // new network, which is accomplished via the globally available IsHalt and // BeginsHalt methods. ForkHalt = "halt" )
Variables ¶
This section is empty.
Functions ¶
func ForkSortFunc ¶
ForkSortFunc is used with slices.SortFunc or slices.SortStableFunc to sort a []*Fork in ascending order by height.
Types ¶
type Fork ¶
Fork identifies a hardfork and its activation height. The semantics and details of the changes associated with the fork are determined by code that is affected by the change, which should check if it is activated by height.
type Forks ¶
type Forks struct { // HaltHeight is the height at which "halt" activates. This stops new transactions. HaltHeight *uint64 // Extended contains any forks that may be defined by extensions. // Potentially we could embed a struct with extension forks. To do that the // extension package would not be able to import common. Extended map[string]*uint64 }
Forks lists the recognized hardforks and their activation heights or times, depending on the fork. A zero value means always active for the chain. A nil pointer (unset in JSON) indicates it is never activated.
func (*Forks) ActivatedBy ¶
ActivatedBy returns a list of Forks names that are active by a certain block height.
func (*Forks) ActivatesAt ¶
ActivatesAt returns a list of the fork names that activate at a certain height. Use ActivatesBy to return forks that activated at or before. The order of the slices is not defined and should not be relied upon.
func (*Forks) BeginsHalt ¶
BeginsHalt returns true if the "halt" rule changes go into effect *at* the given height.
func (*Forks) ForkHeight ¶
ForkHeight returns the activation height of a fork by name, or nil if it never activates.
func (*Forks) FromMap ¶
FromMap populates the Forks fields from a fork heights map. Use if a pre-allocated Forks instance or to merge multiple definitions.