Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions trie/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,23 +367,25 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
// branch. The parent must be a fullnode.
fn := parent.(*fullNode)
fn.Children[key[pos-1]] = nil
} else {
// The key of fork shortnode is greater than the
// path(it doesn't belong to the range), keep
// it with the cached hash available.
}
//else {
// The key of fork shortnode is greater than the
// path(it doesn't belong to the range), keep
// it with the cached hash available.
//}
} else {
if bytes.Compare(cld.Key, key[pos:]) > 0 {
// The key of fork shortnode is greater than the
// path(it belongs to the range), unset the entire
// branch. The parent must be a fullnode.
fn := parent.(*fullNode)
fn.Children[key[pos-1]] = nil
} else {
// The key of fork shortnode is less than the
// path(it doesn't belong to the range), keep
// it with the cached hash available.
}
//else {
// The key of fork shortnode is less than the
// path(it doesn't belong to the range), keep
// it with the cached hash available.
//}
}
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions trie/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func newTracer() *tracer {
}
}

/*
// onRead tracks the newly loaded trie node and caches the rlp-encoded blob internally.
// Don't change the value outside of function since it's not deep-copied.
func (t *tracer) onRead(key []byte, val []byte) {
Expand All @@ -59,6 +60,7 @@ func (t *tracer) onRead(key []byte, val []byte) {
}
t.origin[string(key)] = val
}
*/

// onInsert tracks the newly inserted trie node. If it's already in the deletion set
// (resurrected node), then just wipe it from the deletion set as the "untouched".
Expand Down Expand Up @@ -115,6 +117,7 @@ func (t *tracer) deleteList() [][]byte {
return ret
}

/*
// getPrev returns the cached original value of the specified node.
func (t *tracer) getPrev(key []byte) []byte {
// Don't panic on uninitialized tracer, it's possible in testing.
Expand All @@ -123,6 +126,7 @@ func (t *tracer) getPrev(key []byte) []byte {
}
return t.origin[string(key)]
}
*/

// reset clears the content tracked by tracer.
func (t *tracer) reset() {
Expand Down