blockretainer

package
v1.0.0-beta.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

NewProvider creates a new BlockRetainer provider.

Types

type BlockRetainer

type BlockRetainer struct {
	sync.RWMutex
	module.Module
	// contains filtered or unexported fields
}

func New

func New(subModule module.Module, workersGroup *workerpool.Group, retainerStoreFunc StoreFunc, finalizedSlotFunc FinalizedSlotFunc, errorHandler func(error)) *BlockRetainer

func (*BlockRetainer) BlockMetadata

func (r *BlockRetainer) BlockMetadata(blockID iotago.BlockID) (*api.BlockMetadataResponse, error)

func (*BlockRetainer) CommitSlot

func (r *BlockRetainer) CommitSlot(committedSlot iotago.SlotIndex) error

func (*BlockRetainer) OnBlockAccepted

func (r *BlockRetainer) OnBlockAccepted(block *blocks.Block) error

func (*BlockRetainer) OnBlockBooked

func (r *BlockRetainer) OnBlockBooked(block *blocks.Block) error

OnBlockBooked triggers storing block in the retainer on block booked event.

func (*BlockRetainer) OnBlockConfirmed

func (r *BlockRetainer) OnBlockConfirmed(block *blocks.Block) error

func (*BlockRetainer) OnBlockDropped

func (r *BlockRetainer) OnBlockDropped(block *blocks.Block) error

func (*BlockRetainer) Reset

func (r *BlockRetainer) Reset()

Reset resets the component to a clean state as if it was created at the last commitment.

func (*BlockRetainer) UpdateBlockMetadata

func (r *BlockRetainer) UpdateBlockMetadata(blockID iotago.BlockID, state api.BlockState) error

type FinalizedSlotFunc

type FinalizedSlotFunc func() iotago.SlotIndex

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL