Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockDAG ¶
BlockDAG is a causally ordered DAG that forms the central data structure of the IOTA protocol.
func New ¶
func New(subModule module.Module, workers *workerpool.Group, unsolidCommitmentBufferSize int, evictionState *eviction.State, blockCache *blocks.Blocks, errorHandler func(error), opts ...options.Option[BlockDAG]) (newBlockDAG *BlockDAG)
New is the constructor for the BlockDAG and creates a new BlockDAG instance.
func (*BlockDAG) Append ¶
func (b *BlockDAG) Append(modelBlock *model.Block) (block *blocks.Block, wasAppended bool, err error)
Append is used to append new Blocks to the BlockDAG. It is the main function of the BlockDAG that triggers Events.
func (*BlockDAG) GetOrRequestBlock ¶
GetOrRequestBlock returns the Block with the given BlockID from the BlockDAG (and requests it from the network if it is missing). If the requested Block is below the eviction threshold, then this method will return a nil block without creating it.
Click to show internal directories.
Click to hide internal directories.