mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
mpt: fix extension node cache invalidation
It should always be invalidated if something changes in the `next` (below the extension node). Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
0e29382035
commit
caea6d6ca8
1 changed files with 1 additions and 1 deletions
|
@ -261,7 +261,6 @@ func (t *Trie) deleteFromExtension(n *ExtensionNode, path []byte) (Node, error)
|
||||||
case *ExtensionNode:
|
case *ExtensionNode:
|
||||||
n.key = append(n.key, nxt.key...)
|
n.key = append(n.key, nxt.key...)
|
||||||
n.next = nxt.next
|
n.next = nxt.next
|
||||||
n.invalidateCache()
|
|
||||||
case *HashNode:
|
case *HashNode:
|
||||||
if nxt.IsEmpty() {
|
if nxt.IsEmpty() {
|
||||||
return nxt, nil
|
return nxt, nil
|
||||||
|
@ -269,6 +268,7 @@ func (t *Trie) deleteFromExtension(n *ExtensionNode, path []byte) (Node, error)
|
||||||
default:
|
default:
|
||||||
n.next = r
|
n.next = r
|
||||||
}
|
}
|
||||||
|
n.invalidateCache()
|
||||||
return n, nil
|
return n, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue