Versions in this module Expand all Collapse all v1 v1.0.1 Dec 19, 2019 Changes in this version + var ErrAlreadyProcessed = errors.New("already processed") + var ErrNotRequested = errors.New("not requested") + func CacheMisses() int64 + func CacheUnloads() int64 + func VerifyProof(rootHash common.Hash, key []byte, proofDb DatabaseReader) (value []byte, nodes int, err error) + type Database struct + func NewDatabase(diskdb ethdb.Database) *Database + func (db *Database) Commit(node common.Hash, report bool) error + func (db *Database) Dereference(child common.Hash, parent common.Hash) + func (db *Database) DiskDB() DatabaseReader + func (db *Database) Insert(hash common.Hash, blob []byte) + func (db *Database) Node(hash common.Hash) ([]byte, error) + func (db *Database) Nodes() []common.Hash + func (db *Database) Reference(child common.Hash, parent common.Hash) + func (db *Database) Size() common.StorageSize + type DatabaseReader interface + Get func(key []byte) (value []byte, err error) + Has func(key []byte) (bool, error) + type Iterator struct + Err error + Key []byte + Value []byte + func NewIterator(it NodeIterator) *Iterator + func (it *Iterator) Next() bool + func (it *Iterator) Prove() [][]byte + type LeafCallback func(leaf []byte, parent common.Hash) error + type MissingNodeError struct + NodeHash common.Hash + Path []byte + func (err *MissingNodeError) Error() string + type NodeIterator interface + Error func() error + Hash func() common.Hash + Leaf func() bool + LeafBlob func() []byte + LeafKey func() []byte + LeafProof func() [][]byte + Next func(bool) bool + Parent func() common.Hash + Path func() []byte + func NewDifferenceIterator(a, b NodeIterator) (NodeIterator, *int) + func NewUnionIterator(iters []NodeIterator) (NodeIterator, *int) + type SecureTrie struct + func NewSecure(root common.Hash, db *Database, cachelimit uint16) (*SecureTrie, error) + func (t *SecureTrie) Commit(onleaf LeafCallback) (root common.Hash, err error) + func (t *SecureTrie) Copy() *SecureTrie + func (t *SecureTrie) Delete(key []byte) + func (t *SecureTrie) Get(key []byte) []byte + func (t *SecureTrie) GetKey(shaKey []byte) []byte + func (t *SecureTrie) Hash() common.Hash + func (t *SecureTrie) NodeIterator(start []byte) NodeIterator + func (t *SecureTrie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error + func (t *SecureTrie) Root() []byte + func (t *SecureTrie) TryDelete(key []byte) error + func (t *SecureTrie) TryGet(key []byte) ([]byte, error) + func (t *SecureTrie) TryUpdate(key, value []byte) error + func (t *SecureTrie) Update(key, value []byte) + type SyncResult struct + Data []byte + Hash common.Hash + type Trie struct + func New(root common.Hash, db *Database) (*Trie, error) + func (t *Trie) Commit(onleaf LeafCallback) (root common.Hash, err error) + func (t *Trie) Delete(key []byte) + func (t *Trie) Get(key []byte) []byte + func (t *Trie) Hash() common.Hash + func (t *Trie) NodeIterator(start []byte) NodeIterator + func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error + func (t *Trie) Root() []byte + func (t *Trie) SetCacheLimit(l uint16) + func (t *Trie) TryDelete(key []byte) error + func (t *Trie) TryGet(key []byte) ([]byte, error) + func (t *Trie) TryUpdate(key, value []byte) error + func (t *Trie) Update(key, value []byte) + type TrieSync struct + func NewTrieSync(root common.Hash, database DatabaseReader, callback LeafCallback) *TrieSync + func (s *TrieSync) AddRawEntry(hash common.Hash, depth int, parent common.Hash) + func (s *TrieSync) AddSubTrie(root common.Hash, depth int, parent common.Hash, callback LeafCallback) + func (s *TrieSync) Commit(dbw ethdb.Putter) (int, error) + func (s *TrieSync) Missing(max int) []common.Hash + func (s *TrieSync) Pending() int + func (s *TrieSync) Process(results []SyncResult) (bool, int, error)