mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
mpt: do not create an Extension for the last child of a Branch
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
25428d53f1
commit
a33e422b79
2 changed files with 20 additions and 1 deletions
|
@ -192,7 +192,10 @@ func (t *Trie) stripBranch(b *BranchNode) (Node, error) {
|
|||
case n == 0:
|
||||
return new(HashNode), nil
|
||||
case n == 1:
|
||||
return t.mergeExtension([]byte{lastIndex}, b.Children[lastIndex])
|
||||
if lastIndex != lastChild {
|
||||
return t.mergeExtension([]byte{lastIndex}, b.Children[lastIndex])
|
||||
}
|
||||
return b.Children[lastIndex], nil
|
||||
default:
|
||||
t.addRef(b.Hash(), b.bytes)
|
||||
return b, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue