Documentation ¶
Index ¶
- Variables
- func Slot(now int64) int64
- type Dpos
- func (d *Dpos) Author(header *types.BlockHeader) (utils.Address, error)
- func (d *Dpos) CalcDifficulty(chain consensus.IChainReader, config *params.ChainConfig, time uint64, ...) *big.Int
- func (d *Dpos) CheckValidator(chain consensus.IChainReader, lastBlock *types.Block, coinbase utils.Address, ...) error
- func (d *Dpos) EpchoBlockHeader(chain consensus.IChainReader, timestamp int64, lastBlock *types.Block) *types.BlockHeader
- func (d *Dpos) Finalize(chain consensus.IChainReader, header *types.BlockHeader, state *state.StateDB, ...) (*types.Block, error)
- func (dpos *Dpos) GetBFTConfirmedBlockNumber() (*big.Int, error)
- func (d *Dpos) GetConfirmedBlockNumber() (*big.Int, error)
- func (d *Dpos) Init(chain consensus.IChainReader)
- func (d *Dpos) Seal(chain consensus.IChainReader, block *types.Block, stop <-chan struct{}, ...) (*types.Block, error)
- func (d *Dpos) SetCoinBase(addr utils.Address)
- func (d *Dpos) VerifySeal(chain consensus.IChainReader, header *types.BlockHeader) error
- type EpochContext
- type SignerFn
- type UInt64Slice
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidTimestamp = errors.New("invalid timestamp") ErrWaitForPrevBlock = errors.New("wait for last block arrived") ErrMintIngoreBlock = errors.New("mint the ingore block") ErrMintFutureBlock = errors.New("mint the future block") ErrMismatchSignerAndValidator = errors.New("mismatch block signer and validator") ErrInvalidBlockValidator = errors.New("invalid block validator") ErrTooMuchUnconfirmedBlock = errors.New("too much unconfirmed block") ErrInvalidMintBlockTime = errors.New("invalid time to mint the block") ErrNilBlockHeader = errors.New("nil block header returned") )
Functions ¶
Types ¶
type Dpos ¶
type Dpos struct {
// contains filtered or unexported fields
}
func (*Dpos) CalcDifficulty ¶
func (d *Dpos) CalcDifficulty(chain consensus.IChainReader, config *params.ChainConfig, time uint64, parent *types.BlockHeader) *big.Int
func (*Dpos) CheckValidator ¶
func (*Dpos) EpchoBlockHeader ¶
func (d *Dpos) EpchoBlockHeader(chain consensus.IChainReader, timestamp int64, lastBlock *types.Block) *types.BlockHeader
func (*Dpos) Finalize ¶
func (d *Dpos) Finalize(chain consensus.IChainReader, header *types.BlockHeader, state *state.StateDB, txs []*types.Transaction, actions []*types.Action, receipts []*types.Receipt, dposContext *types.DposContext) (*types.Block, error)
func (*Dpos) GetBFTConfirmedBlockNumber ¶
func (*Dpos) Init ¶
func (d *Dpos) Init(chain consensus.IChainReader)
func (*Dpos) SetCoinBase ¶
func (*Dpos) VerifySeal ¶
func (d *Dpos) VerifySeal(chain consensus.IChainReader, header *types.BlockHeader) error
type EpochContext ¶
type EpochContext struct { TimeStamp int64 DposContext *types.DposContext Statedb *state.StateDB Config *params.ChainConfig }
func (*EpochContext) CountVotes ¶
CountVotes
type UInt64Slice ¶
type UInt64Slice []uint64
UInt64Slice attaches the methods of sort.Interface to []uint64, sorting in increasing order.
func (UInt64Slice) Len ¶
func (s UInt64Slice) Len() int
func (UInt64Slice) Less ¶
func (s UInt64Slice) Less(i, j int) bool
func (UInt64Slice) Swap ¶
func (s UInt64Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.