Documentation ¶
Index ¶
Constants ¶
View Source
const CacheSize = 2000
CacheSize is the amount of blocks above the current height which are stored in the queue.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockqueuer ¶
type Blockqueuer interface { AddBlock(block *block.Block) error AddHeaders(...*block.Header) error BlockHeight() uint32 }
Blockqueuer is an interface for a block queue.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is the block queue.
func New ¶
func New(bc Blockqueuer, log *zap.Logger, relayer func(*block.Block), lenMetricsUpdater func(l int)) *Queue
New creates an instance of BlockQueue.
func (*Queue) Discard ¶
func (bq *Queue) Discard()
Discard stops the queue and prevents it from accepting more blocks to enqueue.
func (*Queue) LastQueued ¶
LastQueued returns the index of the last queued block and the queue's capacity left.
Click to show internal directories.
Click to hide internal directories.