Documentation ¶
Index ¶
- Variables
- type Manager
- func (m *Manager) AcceptBlock(b types.Block) error
- func (m *Manager) BlockAtHeight(height uint64) (types.Block, bool)
- func (m *Manager) Close() error
- func (m *Manager) IndexAtHeight(height uint64) (types.ChainIndex, error)
- func (m *Manager) Network() string
- func (m *Manager) ProcessConsensusChange(cc modules.ConsensusChange)
- func (m *Manager) Subscribe(s modules.ConsensusSetSubscriber, ccID modules.ConsensusChangeID, ...) error
- func (m *Manager) Synced() bool
- func (m *Manager) TipState() consensus.State
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBlockNotFound is returned when a block is not found. ErrBlockNotFound = errors.New("block not found") // ErrInvalidChangeID is returned to a subscriber when the change id is // invalid. ErrInvalidChangeID = errors.New("invalid change id") )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager manages the current state of the blockchain.
func NewManager ¶
func NewManager(cs modules.ConsensusSet) (*Manager, error)
NewManager creates a new chain manager.
func (*Manager) AcceptBlock ¶
AcceptBlock adds b to the consensus set.
func (*Manager) BlockAtHeight ¶
BlockAtHeight returns the block at the given height.
func (*Manager) IndexAtHeight ¶
func (m *Manager) IndexAtHeight(height uint64) (types.ChainIndex, error)
IndexAtHeight return the chain index at the given height.
func (*Manager) ProcessConsensusChange ¶
func (m *Manager) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange implements the modules.ConsensusSetSubscriber interface.
func (*Manager) Subscribe ¶
func (m *Manager) Subscribe(s modules.ConsensusSetSubscriber, ccID modules.ConsensusChangeID, cancel <-chan struct{}) error
Subscribe subscribes to the consensus set.
Click to show internal directories.
Click to hide internal directories.