Versions in this module Expand all Collapse all v1 v1.0.0 Jun 26, 2019 Changes in this version + var ErrInvalidBlockValidator = errors.New("invalid block validator") + var ErrInvalidMintBlockTime = errors.New("invalid time to mint the block") + var ErrInvalidTimestamp = errors.New("invalid timestamp") + var ErrMintFutureBlock = errors.New("mint the future block") + var ErrMismatchSignerAndValidator = errors.New("mismatch block signer and validator") + var ErrNilBlockHeader = errors.New("nil block header returned") + var ErrWaitForPrevBlock = errors.New("wait for last block arrived") + func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, ...) + func NextSlot(now int64) int64 + func PrevSlot(now int64) int64 + type API struct + func (api *API) GetConfirmedBlockNumber() (*big.Int, error) + func (api *API) GetValidators(number *rpc.BlockNumber) ([]common.Address, error) + type Dpos struct + func New(config *params.DposConfig, db ctxcdb.Database) *Dpos + func (d *Dpos) APIs(chain consensus.ChainReader) []rpc.API + func (d *Dpos) Author(header *types.Header) (common.Address, error) + func (d *Dpos) Authorize(signer common.Address, signFn SignerFn) + func (d *Dpos) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int + func (d *Dpos) CheckValidator(lastBlock *types.Block, now int64) error + func (d *Dpos) Coinbase(header *types.Header) (common.Address, error) + func (d *Dpos) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error) + func (d *Dpos) Prepare(chain consensus.ChainReader, header *types.Header) error + func (d *Dpos) Seal(chain consensus.ChainReader, block *types.Block, stop <-chan struct{}) (*types.Block, error) + func (d *Dpos) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error + func (d *Dpos) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error) + func (d *Dpos) VerifySeal(chain consensus.ChainReader, header *types.Header) error + func (d *Dpos) VerifyUncles(chain consensus.ChainReader, block *types.Block) error + type EpochContext struct + DposContext *types.DposContext + TimeStamp int64 + type SignerFn func(accounts.Account, []byte) ([]byte, error)