Documentation ¶
Index ¶
- Constants
- func Factory(ctx context.Context, config *consensus.Config) (consensus.Consensus, error)
- func FrontierDifficulty(time int64, parent *types.Header) uint64
- func HomesteadDifficulty(time int64, parent *types.Header) uint64
- func MetropolisDifficulty(time int64, parent *types.Header, bombDelay uint64) uint64
- type Cache
- type Ethash
- func (e *Ethash) CalcDifficulty(time int64, parent *types.Header) uint64
- func (e *Ethash) Close() error
- func (e *Ethash) Seal(ctx context.Context, block *types.Block) (*types.Block, error)
- func (e *Ethash) SetDAOBlock(n uint64)
- func (e *Ethash) SetFakePow()
- func (e *Ethash) VerifyHeader(parent *types.Header, header *types.Header, uncle, seal bool) error
Constants ¶
View Source
const ByzantiumBombDelay = 3000000
ByzantiumBombDelay is the bomb delay for the Byzantium fork
View Source
const ConstantinopleBombDelay = 5000000
ConstantinopleBombDelay is the bomb delay for the Constantinople fork
View Source
const REVISION = 23
REVISION is the spec revision number of Ethash
Variables ¶
This section is empty.
Functions ¶
func FrontierDifficulty ¶
FrontierDifficulty is the difficulty calculation for the frontier fork
func HomesteadDifficulty ¶
HomesteadDifficulty is the difficulty calculation for the homestead fork
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a 16 MB pseudorandom cache.
type Ethash ¶
type Ethash struct {
// contains filtered or unexported fields
}
Ethash is the ethash consensus algorithm
func (*Ethash) CalcDifficulty ¶
CalcDifficulty calculates the difficulty at a given time.
func (*Ethash) SetDAOBlock ¶
SetDAOBlock sets the dao block, only to be used during tests
func (*Ethash) SetFakePow ¶
func (e *Ethash) SetFakePow()
SetFakePow sets the fakePow flag to true, only used on tests.
Click to show internal directories.
Click to hide internal directories.