Versions in this module Expand all Collapse all v0 v0.4.11 Sep 11, 2023 v0.4.10 Aug 1, 2023 Changes in this version + var ErrHeightAndHashMismatch = errors.New("node height and hash do not match") + var ErrHeightMismatch = errors.New("node height does not match") + var ErrNodeDuplicate = errors.New("node duplicate") + var ErrNodeNoParent = errors.New("node has no parent") + var ErrNodeNotFound = errors.New("node not found") + type BlocksMMRTree struct + func NewTree() *BlocksMMRTree + func (t *BlocksMMRTree) ActualRootForLeafByHash(blockHash chainhash.Hash) (chainhash.Hash, bool) + func (t *BlocksMMRTree) AddBlockWithoutRebuild(hash, actualMMR chainhash.Hash, height int32, difficulty big.Int) + func (t *BlocksMMRTree) AppendBlock(hash chainhash.Hash, difficulty big.Int) error + func (t *BlocksMMRTree) Block(height int32) TreeNode + func (t *BlocksMMRTree) CurrenWeight() *big.Int + func (t *BlocksMMRTree) Current() *TreeNode + func (t *BlocksMMRTree) CurrentRoot() chainhash.Hash + func (t *BlocksMMRTree) LookupNodeByRoot(mmrRoot chainhash.Hash) (TreeNode, bool) + func (t *BlocksMMRTree) MarshalJSON() ([]byte, error) + func (t *BlocksMMRTree) PreAllocateTree(blockCount int) + func (t *BlocksMMRTree) RebuildTreeAndAssert() error + func (t *BlocksMMRTree) ResetRootTo(hash chainhash.Hash, height int32) error + func (t *BlocksMMRTree) RmBlock(height int32) + func (t *BlocksMMRTree) RootForHeight(height int32) chainhash.Hash + func (t *BlocksMMRTree) SetBlock(hash chainhash.Hash, difficulty big.Int, height int32) + type TreeContainer struct + RootToBlock map[chainhash.Hash]chainhash.Hash + func (mmrTree *TreeContainer) SetNodeQuick(node blocknodes.IBlockNode) + func (mmrTree *TreeContainer) SetNodeToMmrWithReorganization(blockNode blocknodes.IBlockNode) (*chainhash.Hash, error) + type TreeNode struct + ActualRoot chainhash.Hash + Hash chainhash.Hash + Height int32 + Weight big.Int + func (n TreeNode) IsFinal() bool + func (n TreeNode) IsNil() bool