Documentation ¶
Index ¶
- Variables
- func NewCollapsedTrie() *collapsedTrie
- type KeyType
- type MerkleTrie
- type PersistentTrie
- func (t *PersistentTrie) Close() error
- func (t *PersistentTrie) Dump(s string)
- func (t *PersistentTrie) Flush() error
- func (t *PersistentTrie) MerkleHash() *chainhash.Hash
- func (t *PersistentTrie) MerkleHashAllClaims() *chainhash.Hash
- func (t *PersistentTrie) SetRoot(h *chainhash.Hash) error
- func (t *PersistentTrie) Update(name []byte, hash *chainhash.Hash, restoreChildren bool)
- type RamTrie
- func (pt *RamTrie) Erase(value KeyType) bool
- func (pt *RamTrie) Find(value KeyType) *collapsedVertex
- func (pt *RamTrie) FindPath(value KeyType) ([]int, []*collapsedVertex)
- func (rt *RamTrie) Flush() error
- func (pt *RamTrie) InsertOrFind(value KeyType) (bool, *collapsedVertex)
- func (pt *RamTrie) IterateFrom(start KeyType, handler func(name KeyType, value *collapsedVertex) bool)
- func (rt *RamTrie) MerkleHash() *chainhash.Hash
- func (rt *RamTrie) MerkleHashAllClaims() *chainhash.Hash
- func (pt *RamTrie) NodeCount() int
- func (rt *RamTrie) SetRoot(h *chainhash.Hash) error
- func (rt *RamTrie) Update(name []byte, h *chainhash.Hash, _ bool)
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // EmptyTrieHash represents the Merkle Hash of an empty PersistentTrie. // "0000000000000000000000000000000000000000000000000000000000000001" EmptyTrieHash = &chainhash.Hash{1} NoChildrenHash = &chainhash.Hash{2} NoClaimsHash = &chainhash.Hash{3} )
View Source
var ErrFullRebuildRequired = errors.New("a full rebuild is required")
Functions ¶
func NewCollapsedTrie ¶
func NewCollapsedTrie() *collapsedTrie
Types ¶
type MerkleTrie ¶
type PersistentTrie ¶
type PersistentTrie struct {
// contains filtered or unexported fields
}
PersistentTrie implements a 256-way prefix tree.
func NewPersistentTrie ¶
func NewPersistentTrie(repo Repo) *PersistentTrie
NewPersistentTrie returns a PersistentTrie.
func (*PersistentTrie) Close ¶
func (t *PersistentTrie) Close() error
func (*PersistentTrie) Dump ¶
func (t *PersistentTrie) Dump(s string)
func (*PersistentTrie) Flush ¶
func (t *PersistentTrie) Flush() error
func (*PersistentTrie) MerkleHash ¶
func (t *PersistentTrie) MerkleHash() *chainhash.Hash
MerkleHash returns the Merkle Hash of the PersistentTrie. All nodes must have been resolved before calling this function.
func (*PersistentTrie) MerkleHashAllClaims ¶
func (t *PersistentTrie) MerkleHashAllClaims() *chainhash.Hash
type RamTrie ¶
type RamTrie struct {
// contains filtered or unexported fields
}
func NewRamTrie ¶
func NewRamTrie() *RamTrie
func (*RamTrie) InsertOrFind ¶
func (*RamTrie) IterateFrom ¶
func (pt *RamTrie) IterateFrom(start KeyType, handler func(name KeyType, value *collapsedVertex) bool)
IterateFrom can be used to find a value and run a function on that value. If the handler returns true it continues to iterate through the children of value.
func (*RamTrie) MerkleHash ¶
func (*RamTrie) MerkleHashAllClaims ¶
Click to show internal directories.
Click to hide internal directories.