Versions in this module Expand all Collapse all v0 v0.0.2 Dec 21, 2022 v0.0.1 Dec 21, 2022 Changes in this version + var ErrCommonAncestorNotFound = errors.New("header is nil") + var ErrConnectionClosed = errors.New("connection closed") + var ErrDecodeDifficulty = errors.New("failed to decode difficulty") + var ErrDisposed = errors.New(`queue: disposed`) + var ErrEmptyQueue = errors.New(`queue: empty queue`) + var ErrForkNotFound = errors.New("fork not found") + var ErrInvalidTypeAssertion = errors.New("invalid type assertion") + var ErrLoadLocalGenesisFailed = errors.New("failed to read local genesis") + var ErrMismatchGenesis = errors.New("genesis does not match") + var ErrPopTimeout = errors.New("timeout") + var ErrTimeout = errors.New(`queue: poll timed out`) + var ErrTooManyHeaders = errors.New("unexpected more than 1 result") + type PriorityQueue struct + func NewPriorityQueue(hint int, allowDuplicates bool) *PriorityQueue + func (pq *PriorityQueue) Dispose() + func (pq *PriorityQueue) Disposed() bool + func (pq *PriorityQueue) Empty() bool + func (pq *PriorityQueue) Get(number int) ([]*types.Block, error) + func (pq *PriorityQueue) Latest() uint64 + func (pq *PriorityQueue) Len() int + func (pq *PriorityQueue) Peek() *types.Block + func (pq *PriorityQueue) Put(items ...*types.Block) error + type Status struct + Difficulty *big.Int + Hash types.Hash + Number uint64 + func (s *Status) Copy() *Status + type SyncPeer struct + func (s *SyncPeer) ID() peer.ID + func (s *SyncPeer) IsClosed() bool + func (s *SyncPeer) Number() uint64 + func (s *SyncPeer) Status() connectivity.State + type Syncer struct + func NewSyncer(logger hclog.Logger, server *network.Server, blockchain blockchainShim, ...) *Syncer + func (s *Syncer) AddPeer(peerID peer.ID) error + func (s *Syncer) BestPeer() *SyncPeer + func (s *Syncer) Broadcast(b *types.Block) + func (s *Syncer) Close() error + func (s *Syncer) DeletePeer(peerID peer.ID) error + func (s *Syncer) GetSyncProgression() *progress.Progression + func (s *Syncer) Start(ctx context.Context) + func (s *Syncer) StartToRecieveNewBlock() + func (s *Syncer) SyncWork(ctx context.Context) + func (s *Syncer) TakePeerByHeight(height, num uint64) []*SyncPeer + func (s *Syncer) WatchSync(ctx context.Context)