Versions in this module Expand all Collapse all v1 v1.1.2 Sep 16, 2021 Changes in this version + type BlockIndex struct + func NewBlockIndex() *BlockIndex + func NewBlockIndexWithData(index map[bc.Hash]*BlockNode, mainChain []*BlockNode) *BlockIndex + func (bi *BlockIndex) AddNode(node *BlockNode) + func (bi *BlockIndex) BestNode() *BlockNode + func (bi *BlockIndex) BlockExist(hash *bc.Hash) bool + func (bi *BlockIndex) Equals(bi1 *BlockIndex) bool + func (bi *BlockIndex) GetNode(hash *bc.Hash) *BlockNode + func (bi *BlockIndex) InMainchain(hash bc.Hash) bool + func (bi *BlockIndex) NodeByHeight(height uint64) *BlockNode + func (bi *BlockIndex) SetMainChain(node *BlockNode) + type BlockNode struct + Bits uint64 + Hash bc.Hash + Height uint64 + Nonce uint64 + Parent *BlockNode + Seed *bc.Hash + Timestamp uint64 + TransactionStatusHash bc.Hash + TransactionsMerkleRoot bc.Hash + Version uint64 + WorkSum *big.Int + func NewBlockNode(bh *types.BlockHeader, parent *BlockNode) (*BlockNode, error) + func (node *BlockNode) BlockHeader() *types.BlockHeader + func (node *BlockNode) CalcNextBits() uint64 + func (node *BlockNode) CalcNextSeed() *bc.Hash + func (node *BlockNode) CalcPastMedianTime() uint64 + type UtxoViewpoint struct + Entries map[bc.Hash]*storage.UtxoEntry + func NewUtxoViewpoint() *UtxoViewpoint + func (view *UtxoViewpoint) ApplyBlock(block *bc.Block, txStatus *bc.TransactionStatus) error + func (view *UtxoViewpoint) ApplyTransaction(block *bc.Block, tx *bc.Tx, statusFail bool) error + func (view *UtxoViewpoint) CanSpend(hash *bc.Hash) bool + func (view *UtxoViewpoint) DetachBlock(block *bc.Block, txStatus *bc.TransactionStatus) error + func (view *UtxoViewpoint) DetachTransaction(tx *bc.Tx, statusFail bool) error + func (view *UtxoViewpoint) HasUtxo(hash *bc.Hash) bool