mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
trie: remove unused field dirtyCount
This commit is contained in:
parent
5f0d62c7db
commit
e0c1fec36a
1 changed files with 0 additions and 7 deletions
|
|
@ -48,10 +48,6 @@ type LeafCallback func(leaf []byte, parent common.Hash) error
|
|||
type Trie struct {
|
||||
db *Database
|
||||
root node
|
||||
// Keep a track of the number of leafs to commit. This counter is
|
||||
// update for inserts and deletions of leafs, but does not accurately track the number
|
||||
// of nodes
|
||||
dirtyCount int
|
||||
// Keep track of the number leafs which have been inserted since the last
|
||||
// hashing operation. This number will not directly map to the number of
|
||||
// actually unhashed nodes
|
||||
|
|
@ -172,7 +168,6 @@ func (t *Trie) Update(key, value []byte) {
|
|||
// If a node was not found in the database, a MissingNodeError is returned.
|
||||
func (t *Trie) TryUpdate(key, value []byte) error {
|
||||
t.unhashedCount++
|
||||
t.dirtyCount++
|
||||
k := keybytesToHex(key)
|
||||
if len(value) != 0 {
|
||||
_, n, err := t.insert(t.root, nil, k, valueNode(value))
|
||||
|
|
@ -270,7 +265,6 @@ func (t *Trie) Delete(key []byte) {
|
|||
// If a node was not found in the database, a MissingNodeError is returned.
|
||||
func (t *Trie) TryDelete(key []byte) error {
|
||||
t.unhashedCount++
|
||||
t.dirtyCount++
|
||||
k := keybytesToHex(key)
|
||||
_, n, err := t.delete(t.root, nil, k)
|
||||
if err != nil {
|
||||
|
|
@ -463,7 +457,6 @@ func (t *Trie) Commit(onleaf LeafCallback) (root common.Hash, err error) {
|
|||
if err != nil {
|
||||
return common.Hash{}, err
|
||||
}
|
||||
t.dirtyCount = 0
|
||||
t.root = newRoot
|
||||
return rootHash, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue