Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockIndex ¶
type BlockIndex struct {
// contains filtered or unexported fields
}
BlockIndex is an chainindex from hash to BlockRow.
func InitBlocksIndex ¶
func InitBlocksIndex(genesisBlock primitives.Block) (*BlockIndex, error)
InitBlocksIndex creates a new block chainindex.
func (*BlockIndex) Add ¶
func (i *BlockIndex) Add(block *primitives.Block) (*BlockRow, error)
Add adds a row to the block chainindex.
func (*BlockIndex) Get ¶
func (i *BlockIndex) Get(hash chainhash.Hash) (*BlockRow, bool)
Get gets a block from the block index.
func (*BlockIndex) Have ¶
func (i *BlockIndex) Have(hash chainhash.Hash) bool
Have checks if the block chainindex contains a certain hash.
func (*BlockIndex) LoadBlockNode ¶
func (i *BlockIndex) LoadBlockNode(row *primitives.BlockNodeDisk) (*BlockRow, error)
LoadBlockNode loads a block node and connects it to the parent block.
type BlockRow ¶
type BlockRow struct { StateRoot chainhash.Hash Height uint64 Slot uint64 Hash chainhash.Hash Parent *BlockRow // contains filtered or unexported fields }
BlockRow represents a single row in the block chainindex.
func (*BlockRow) GetAncestorAtHeight ¶
GetAncestorAtHeight gets the block row ancestor at a certain height.
func (*BlockRow) GetAncestorAtSlot ¶
GetAncestorAtSlot gets the block row ancestor at a certain slot.
func (*BlockRow) ToBlockNodeDisk ¶
func (br *BlockRow) ToBlockNodeDisk() *primitives.BlockNodeDisk
ToBlockNodeDisk converts an in-memory representation of a block row to a serializable version.
Click to show internal directories.
Click to hide internal directories.