check in trie.hook was transformed incorrectly (#372)

This commit is contained in:
Alex Sharov 2020-02-17 13:24:07 +07:00 committed by GitHub
parent b541bff1eb
commit 21ce7b4c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -599,9 +599,13 @@ func (t *Trie) hook(hex []byte, n node) {
if !ok {
return
}
if _, ok := nd.(valueNode); ok {
return
}
if _, ok := nd.(hashNode); !ok && nd != nil {
return
}
t.touchAll(n, hex, false)
switch p := parent.(type) {
case nil:
@ -1007,8 +1011,6 @@ func (t *Trie) unload(hex []byte, h *hasher) {
switch hex[len(hex)-1] {
case i1:
p.child1 = hnode
case i2:
p.child1 = hnode
case i2:
p.child2 = hnode
}